:root {
    --ink: #22303a;
    --paper: #eef1ef;
    --card: #ffffff;
    --accent: #b8862e;
    --accent-dark: #8f6a22;
    --muted: #5c6b72;
    --line: #d7dcd9;
    --danger: #a4372f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; margin: 0 0 0.5em; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--ink);
    color: #fff;
}
.topbar a { color: #fff; }
.topbar .brand { font-family: Georgia, serif; font-size: 1.2rem; }
.topbar .who { font-size: 0.9rem; opacity: 0.85; }
.topbar .who a { color: #fff; }

.btn-back-list {
    display: inline-block;
    background: #c0392b;
    color: #fff !important;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 6px;
    line-height: 1.2;
}
.btn-back-list:hover { background: #a5301f; text-decoration: none; }

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.container.narrow { max-width: 420px; }

/* --- Login / Passwort-Formulare --- */
.form-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 28px 24px;
    margin-top: 40px;
}
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.92rem; color: var(--muted); }
.field input, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }

button, .btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}
button:hover, .btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: #fff; }

.error {
    background: #f6e3e1;
    color: var(--danger);
    border: 1px solid #e2b6b0;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}
.notice {
    background: #eaf1e6;
    color: #3c5a2e;
    border: 1px solid #c7dcbc;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.hint { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }

/* --- Personenliste --- */
.person-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.person-row:hover { background: #fff; text-decoration: none; }
.person-row .thumb, .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.person-row .name { font-size: 1.02rem; }
.person-row .you-tag {
    margin-left: auto;
    font-size: 0.78rem;
    color: #d32f2f;
    border: 1px solid #d32f2f;
    text-decoration: underline;
    padding: 2px 8px;
    border-radius: 12px;
}

/* --- Detailseite --- */
.profile-head { text-align: center; margin-bottom: 28px; }

/* Foto und Vorstellungsvideo nebeneinander in derselben Horizontalen,
   beide gleich groß (140x140); bei fehlendem Video bleibt nur das Foto
   übrig und wird weiterhin zentriert. */
.profile-media-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.profile-media-row .media-slot { flex: 0 0 auto; }
.profile-head .avatar-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
}
.profile-head .avatar-video {
    width: 140px;
    height: 140px;
    border-radius: 10px;
    object-fit: cover;
    background: #000;
    display: block;
}
/* Im Vollbild (Video einer anderen Person) den ganzen Bildschirm nutzen,
   ohne Zuschnitt; danach gilt wieder die Vorschaugröße von oben. */
.profile-head .avatar-video:fullscreen { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.profile-head .avatar-video:-webkit-full-screen { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.profile-head .btn-copy-link {
    display: block;
    width: 140px;
    margin-top: 8px;
    padding: 6px 8px;
    font-size: 0.85rem;
}
.profile-head h1 { font-size: 1.6rem; }

/* Zusätzlicher Speichern-Button oben im Bearbeiten-Formular */
.btn-save-top { display: block; width: 100%; margin-bottom: 22px; }

/* Foto-/Video-Upload: pro Zeile "[Box: Beschriftung] Datei auswählen";
   der Upload startet automatisch nach der Dateiauswahl (kein Button). Die
   beiden Zeilen stehen untereinander, darunter die Hinweiszeilen. */
.profile-uploads { margin-top: 10px; display: inline-block; text-align: left; max-width: 100%; }
.profile-uploads .upload-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 10px;
}
.profile-uploads .upload-row label {
    /* Box im Stil des "Speichern"-Buttons; Klick öffnet die Dateiauswahl */
    flex: 0 0 auto;
    min-width: 15em;
    text-align: center;
    white-space: nowrap;
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}
.profile-uploads .upload-row label:hover { background: var(--accent-dark); }
.profile-uploads .upload-row input[type="file"] { flex: 0 1 220px; min-width: 0; max-width: 100%; }
.profile-uploads .hint { margin: 2px 0 0; }

/* Passwort-Felder: Augen-Symbol rechts im Feld (assets/password-toggle.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input, .field .pw-wrap input { padding-right: 44px; }
.pw-wrap .pw-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: transparent;
    color: var(--muted);
    border-radius: 4px;
    line-height: 0;
}
.pw-wrap .pw-toggle:hover { background: transparent; color: var(--ink); }
.pw-wrap .pw-toggle:focus-visible { outline: 2px solid var(--accent); }

.info-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.info-block .label { font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.info-block .value { white-space: pre-wrap; word-break: break-word; }
.info-block .value:empty::after,
.info-block .value.is-empty::after { content: "—"; color: var(--muted); }

.edit-note {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 16px;
}

/* --- Suche --- */
.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
}
.search-form input[type="text"] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 1rem;
}

/* --- Admin --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.94rem;
    vertical-align: middle;
}
.admin-table th { background: #f4f6f4; color: var(--muted); font-weight: 600; }
.admin-actions { display: flex; flex-direction: column; gap: 8px; }
.admin-actions form { margin: 0; }
.admin-btn-row, .admin-edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-btn-row .push-end { margin-left: auto; }

.tag {
    display: inline-block;
    font-size: 0.78rem;
    padding: 2px 9px;
    border-radius: 12px;
    border: 1px solid transparent;
}
.tag-pending { background: #f6e9d8; color: #8f6a22; border-color: #e6cfa2; }
.tag-ok { background: #eaf1e6; color: #3c5a2e; border-color: #c7dcbc; }
.tag-locked { background: #f6e3e1; color: var(--danger); border-color: #e2b6b0; }
.tag-disabled { background: #e6e8e7; color: #4a5559; border-color: #b9c0bd; font-weight: 600; margin-bottom: 4px; }

.btn-danger {
    background: var(--danger);
}
.btn-danger:hover { background: #832a24; }

/* --- Rechtstexte (AGB, Datenschutz, Impressum) --- */
.legal-box {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px 18px;
    background: #fbfbf9;
    margin: 16px 0 20px;
}
.legal-text h1 { font-size: 1.5rem; margin-bottom: 18px; }
.legal-text h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.legal-text h3:first-child { margin-top: 0; }
.legal-text p, .legal-text ul { font-size: 0.95rem; margin: 0 0 10px; }
.legal-text ul { padding-left: 20px; }

.footer-links {
    text-align: center;
    margin-top: 32px;
    font-size: 0.85rem;
    color: var(--muted);
}
.footer-links a { color: var(--muted); }

/* --- Admin: Log-Tabelle --- */
.log-table { font-size: 0.88rem; }
.log-table td, .log-table th { padding: 7px 10px; }
.log-table .action-tag {
    display: inline-block;
    font-size: 0.76rem;
    padding: 1px 7px;
    border-radius: 10px;
    background: #eef1ef;
    color: var(--muted);
}
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type="tel"] {
    width: 150px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 0.88rem;
}

/* --- Partner-Portal: Länderkennzeichen DE / CH --- */
.country-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
}
.person-row .country-tag { margin-left: auto; }
.person-row .you-tag + .country-tag { margin-left: 8px; } /* "Du" steht links von DE/CH */
.country-ch { color: #a4372f; border-color: #a4372f; }
.country-de { color: var(--ink); border-color: var(--ink); }
.country-at { color: #1a5fb4; border-color: #1a5fb4; }
.profile-head h1 .country-tag { font-size: 0.8rem; }
.partner-share-card { margin-top: 24px; }
.partner-share-card h2 { font-size: 1.1rem; margin: 0 0 8px; }
.partner-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: 12px 0 24px; }
.partner-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.partner-box dt { color: var(--muted); font-size: 0.88rem; }
.partner-box dd { margin: 0; word-break: break-word; }
.tag-share { background: #e3efe3; color: #2b5d2b; }

/* Login: Hinweis "Account anfordern" */
.account-request { text-align: center; margin: 16px 0 8px; }
