/* PCmobil24 – Diagnose-Assistent
   Heller Grund, dunkle Schrift, Systemschriften, kein externes CDN. */

:root {
    --grund: #ffffff;
    --flaeche: #f4f6f8;
    --rand: #d6dce2;
    --text: #16202a;
    --text-leise: #45525e;
    --akzent: #0b4a7a;
    --akzent-hell: #e8f0f7;
    --warm: #a8480f;
    --warm-hell: #fdf1e8;
    --radius: 10px;
    --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font-family: var(--schrift);
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* --- Kopf ---------------------------------------------------------------- */

.kopf {
    border-bottom: 1px solid var(--rand);
    background: var(--grund);
}

.kopf-innen {
    max-width: 52rem;
    margin: 0 auto;
    padding: 0.9rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.marke {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--akzent);
    text-decoration: none;
}

.marke span {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-leise);
}

.kopf-kontakt {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* --- Schaltflächen ------------------------------------------------------- */

.knopf,
button.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--akzent);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.knopf:hover { background: #093c63; }

.knopf.leise {
    background: var(--grund);
    color: var(--akzent);
}

.knopf.leise:hover { background: var(--akzent-hell); }

.knopf:focus-visible,
a:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--warm);
    outline-offset: 2px;
}

.knopf[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Layout -------------------------------------------------------------- */

main {
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

h1 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

h2 {
    font-size: 1.2rem;
    margin: 2rem 0 0.6rem;
}

.vorspann {
    color: var(--text-leise);
    margin: 0 0 1.5rem;
    max-width: 40rem;
}

/* --- Startbildschirm ----------------------------------------------------- */

.kategorien {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.kategorie {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.kategorie:hover {
    border-color: var(--akzent);
    background: var(--akzent-hell);
}

.kategorie strong { display: block; font-size: 1.05rem; }

.kategorie em {
    display: block;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--text-leise);
    margin-top: 0.15rem;
}

.hinweis {
    border: 1px solid var(--rand);
    border-left: 4px solid var(--warm);
    background: var(--warm-hell);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    color: var(--text);
    margin: 0 0 1.5rem;
}

.hinweis p { margin: 0 0 0.5rem; }
.hinweis p:last-child { margin: 0; }

/* --- Chat ---------------------------------------------------------------- */

.chat { display: none; }
.chat.aktiv { display: block; }
.start.versteckt { display: none; }

.verlauf {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0 0 1.25rem;
    min-height: 12rem;
}

.blase {
    max-width: 90%;
    padding: 0.85rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid var(--rand);
    overflow-wrap: break-word;
}

.blase.ich {
    align-self: flex-end;
    background: var(--akzent-hell);
    border-color: #bcd3e6;
}

.blase.assistent {
    align-self: flex-start;
    background: var(--flaeche);
}

.blase.stoerung {
    align-self: stretch;
    max-width: none;
    background: var(--warm-hell);
    border-left: 4px solid var(--warm);
}

.blase p { margin: 0 0 0.7rem; }
.blase p:last-child { margin: 0; }
.blase ol,
.blase ul { margin: 0 0 0.7rem; padding-left: 1.4rem; }
.blase li { margin-bottom: 0.35rem; }
.blase a { color: var(--akzent); }

.rolle {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-leise);
    margin-bottom: 0.35rem;
}

.tippt::after {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 1rem;
    margin-left: 0.15rem;
    background: var(--text-leise);
    vertical-align: text-bottom;
    animation: blinken 1s steps(2, start) infinite;
}

@keyframes blinken { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
    .tippt::after { animation: none; }
}

/* --- Eingabe ------------------------------------------------------------- */

.eingabe {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    border-top: 1px solid var(--rand);
    padding-top: 1rem;
}

.eingabe textarea {
    flex: 1;
    min-height: 48px;
    max-height: 12rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--grund);
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.werkzeuge {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.rueckmeldung {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rand);
    font-size: 0.95rem;
    color: var(--text-leise);
}

.rueckmeldung .knopf { min-height: 44px; padding: 0.45rem 0.9rem; }

/* --- Fuß ----------------------------------------------------------------- */

.fuss {
    border-top: 1px solid var(--rand);
    background: var(--flaeche);
    margin-top: 3rem;
}

.fuss-innen {
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-leise);
}

.fuss a { color: var(--akzent); }
.fuss ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* --- Rechtstexte --------------------------------------------------------- */

.rechtstext { max-width: 44rem; }
.rechtstext h2 { margin-top: 2rem; }
.rechtstext ul { padding-left: 1.3rem; }

.nur-fuer-screenreader {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Übergabe an PCmobil24 ----------------------------------------------- */

.uebergabe {
    margin-top: 1.75rem;
    padding: 1.25rem;
    border: 1px solid var(--rand);
    border-left: 4px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--flaeche);
}

.uebergabe h2 { margin-top: 0; }

.uebergabe > p { max-width: 38rem; }

.feld {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0 0 0.9rem;
    max-width: 28rem;
}

.feld label { font-weight: 600; font-size: 0.95rem; }

.feld input[type="text"],
.feld input[type="email"],
.feld input[type="tel"],
.feld textarea {
    min-height: 48px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--grund);
    color: var(--text);
    font: inherit;
}

.feld textarea { min-height: 5rem; resize: vertical; }

.feld input:focus-visible,
.feld textarea:focus-visible {
    outline: 3px solid var(--warm);
    outline-offset: 2px;
}

.feld.ankreuz {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
}

.feld.ankreuz input {
    width: 1.35rem;
    height: 1.35rem;
    flex: none;
}

.feld.ankreuz label { font-weight: 400; }

.hilfstext {
    font-size: 0.9rem;
    color: var(--text-leise);
    max-width: 34rem;
    margin: 0 0 1rem;
}

/* Der Honigtopf muss für Bots im Quelltext stehen, für Menschen aber
   unsichtbar sein – auch für Screenreader. */
.honigtopf {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.uebergabe-danke {
    border-left: 4px solid var(--akzent);
    padding-left: 1rem;
}

/* --- Größere Schrift ------------------------------------------------------ */

body.grosse-schrift { font-size: 1.28rem; }
body.grosse-schrift .kategorie strong { font-size: 1.15rem; }
body.grosse-schrift .rolle { font-size: 0.9rem; }

.knopf.klein {
    min-height: 44px;
    padding: 0.4rem 0.7rem;
}

#schrift .gross { font-size: 1.35em; font-weight: 700; }

/* --- Gespräch fortsetzen -------------------------------------------------- */

.fortsetzen {
    border: 1px solid var(--rand);
    border-left: 4px solid var(--akzent);
    background: var(--akzent-hell);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin: 0 0 1.5rem;
}

.fortsetzen p { margin: 0 0 0.75rem; }
.fortsetzen .werkzeuge { margin-top: 0; }

/* --- Foto ----------------------------------------------------------------- */

.foto-vorschau {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 0.9rem;
    padding: 0.85rem;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--flaeche);
}

.foto-vorschau img {
    width: 7rem;
    height: auto;
    border: 1px solid var(--rand);
    border-radius: 6px;
    flex: none;
}

.foto-vorschau p {
    margin: 0 0 0.6rem;
    font-size: 0.92rem;
    color: var(--text-leise);
}

.blase-bild {
    display: block;
    max-width: min(100%, 20rem);
    height: auto;
    border: 1px solid var(--rand);
    border-radius: 6px;
    margin-bottom: 0.6rem;
}

#foto-knopf { font-size: 1.2rem; padding-left: 0.85rem; padding-right: 0.85rem; }

/* --- Druckansicht: der Verlauf als Anleitung zum Danebenlegen ------------- */

@media print {
    .kopf-kontakt,
    .eingabe,
    .werkzeuge,
    .rueckmeldung,
    .uebergabe,
    .foto-vorschau,
    .hinweis,
    .fortsetzen,
    .start { display: none !important; }

    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
    }

    main { max-width: none; padding: 0; }

    .kopf, .fuss {
        border: 0;
        background: transparent;
    }

    .kopf-innen, .fuss-innen { padding: 0 0 0.5rem; }

    .verlauf { gap: 0.6rem; }

    .blase {
        max-width: none;
        align-self: stretch;
        border: 0;
        border-left: 2pt solid #666;
        border-radius: 0;
        background: transparent;
        padding: 0.2rem 0 0.2rem 0.6rem;
        /* Einen Schritt nicht über den Seitenumbruch reißen */
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .blase.ich { border-left-color: #000; }

    .blase-bild { max-width: 9cm; }

    .rolle { color: #000; font-weight: 700; }

    a { color: #000; text-decoration: underline; }

    /* Linkziele ausschreiben – auf Papier nützt ein Klick nichts */
    .blase a::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        word-break: break-all;
    }
}

/* --- Sprachwahl ----------------------------------------------------------- */

.sprachwahl {
    min-height: 44px;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--grund);
    color: var(--akzent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sprachwahl:focus-visible {
    outline: 3px solid var(--warm);
    outline-offset: 2px;
}

/* Von rechts nach links geschriebene Sprachen */
[dir="rtl"] .blase.ich { align-self: flex-start; }
[dir="rtl"] .blase.assistent { align-self: flex-end; }
[dir="rtl"] .kategorie { text-align: right; }
[dir="rtl"] .uebergabe,
[dir="rtl"] .fortsetzen,
[dir="rtl"] .hinweis,
[dir="rtl"] .uebergabe-danke {
    border-left: 1px solid var(--rand);
    border-right: 4px solid var(--akzent);
}
[dir="rtl"] .feld { text-align: right; }

@media print {
    .sprachwahl { display: none !important; }
}

/* --- Ratgeberseiten ------------------------------------------------------- */

.ratgeber { max-width: 44rem; }
.ratgeber h1 { font-size: 1.7rem; margin-bottom: 1rem; }
.ratgeber h2 { font-size: 1.25rem; margin-top: 2.2rem; }
.ratgeber h3 { font-size: 1.08rem; margin-top: 1.6rem; }
.ratgeber ol, .ratgeber ul { padding-left: 1.4rem; }
.ratgeber li { margin-bottom: 0.4rem; }
.ratgeber code {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.92em;
}

.brotkrumen {
    font-size: 0.9rem;
    color: var(--text-leise);
    margin-bottom: 1.25rem;
}
.brotkrumen a { color: var(--akzent); }

.ratgeber-liste {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.75rem;
}

.ratgeber-liste a {
    display: block;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--flaeche);
    color: var(--text);
    text-decoration: none;
}

.ratgeber-liste a:hover {
    border-color: var(--akzent);
    background: var(--akzent-hell);
}

.ratgeber-liste strong { display: block; color: var(--akzent); margin-bottom: 0.3rem; }
.ratgeber-liste span { font-size: 0.92rem; color: var(--text-leise); }

.ratgeber-hilfe {
    margin-top: 2.5rem;
    padding: 1.25rem;
    border: 1px solid var(--rand);
    border-left: 4px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--akzent-hell);
}

.ratgeber-hilfe h2 { margin-top: 0; font-size: 1.15rem; }

.ratgeber-verweis {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: var(--text-leise);
}
.ratgeber-verweis a { color: var(--akzent); }

@media print { .ratgeber-verweis { display: none !important; } }
