/* Museums-Chat — mobile-first */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #f2efe9;
    color: #2b2b2b;
    line-height: 1.45;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #3d3229;
    color: #f2efe9;
}
.topbar .brand { color: inherit; text-decoration: none; font-weight: 700; display: flex; align-items: center; }
.topbar .logo { height: 2rem; display: block; }
.topbar nav a { color: #d8c9a3; margin-left: 1rem; text-decoration: none; }

body.font-large { font-size: 1.15rem; }

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

/* --- Bottom-Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: #3d3229;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.25);
    z-index: 10;
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0 0.4rem;
    color: #b0a591;
    text-decoration: none;
    font-size: 0.68rem;
}
.bottom-nav a svg { width: 1.35rem; height: 1.35rem; }
.bottom-nav a.active { color: #f2d9a0; }

.error {
    background: #fbe3e0;
    border: 1px solid #d9958c;
    color: #7a2318;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
}
.notice {
    background: #e4efe2;
    border: 1px solid #8fb388;
    color: #2c5426;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
}

/* --- Startseite --- */
.home { text-align: center; padding-top: 2rem; }
.hello { color: #8a6d3b; font-weight: 600; }
.name-card {
    background: #fdfbf6;
    border: 1.5px solid #d8c9a3;
    border-radius: 14px;
    padding: 1rem;
    margin: 1rem 0;
}
.name-card p { margin: 0 0 0.6rem; font-weight: 600; }
.name-form { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.name-form input {
    padding: 0.45rem 0.7rem;
    border: 1.5px solid #b8a888;
    border-radius: 10px;
    font-size: 1rem;
}
.name-form button {
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 10px;
    background: #8a6d3b;
    color: #fff;
}
.name-form button.skip { background: none; color: #6f675c; text-decoration: underline; }
.number-form { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.5rem; }
.number-input {
    width: 8rem;
    font-size: 2rem;
    text-align: center;
    padding: 0.4rem;
    border: 2px solid #b8a888;
    border-radius: 10px;
    background: #fff;
}
.number-form button {
    font-size: 1.3rem;
    padding: 0.4rem 1.4rem;
    border: none;
    border-radius: 10px;
    background: #8a6d3b;
    color: #fff;
    cursor: pointer;
}

/* --- Chat --- */
.chat-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #d9d2c4;
    margin-bottom: 1rem;
}
.obj-badge {
    background: #8a6d3b;
    color: #fff;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.messages { display: flex; flex-direction: column; gap: 0.6rem; }
.bubble {
    max-width: 85%;
    padding: 0.6rem 0.9rem;
    border-radius: 16px;
    white-space: pre-line;
}
.from-object {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #ddd5c4;
    border-bottom-left-radius: 4px;
}
.from-visitor {
    align-self: flex-end;
    background: #4a6b52;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.hint { color: #6f675c; margin: 1.2rem 0 0.4rem; }

.questions { display: flex; flex-direction: column; gap: 0.5rem; }
.questions button {
    text-align: left;
    font-size: 1rem;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid #8a6d3b;
    border-radius: 12px;
    background: #fdfbf6;
    color: #5c4726;
    cursor: pointer;
}
.questions button:hover { background: #f3e8d2; }

.chat-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid #d9d2c4;
}
.chat-actions a { color: #6f675c; text-decoration: none; font-size: 0.95rem; }

/* --- Admin --- */
.admin-login { max-width: 320px; margin: 3rem auto; text-align: center; }
.admin-login input { width: 100%; padding: 0.5rem; margin-bottom: 0.8rem; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 0.45rem 0.6rem; border: 1px solid #ddd5c4; text-align: left; }
.admin-table tr.inactive td { color: #a09a8e; }
.row-actions form { display: flex; gap: 0.3rem; }

.inline-form { display: flex; gap: 0.4rem; align-items: center; margin: 0.4rem 0; flex-wrap: wrap; }
.inline-form input[type=text] { flex: 1; min-width: 220px; padding: 0.4rem; }

.item-list { list-style: none; padding: 0; margin: 0.4rem 0; }
.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #ddd5c4;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.35rem;
}
.item-list li.empty { color: #a09a8e; font-style: italic; border-style: dashed; }
.item-list .inline-form { margin: 0; }

.topic-box {
    background: #faf7f0;
    border: 1px solid #ddd5c4;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.9rem;
}
.topic-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tag {
    background: #d8c9a3;
    color: #4a3d24;
    border-radius: 999px;
    padding: 0.05rem 0.6rem;
    font-size: 0.8rem;
}

/* --- Objektseite --- */
.object-photo {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}
.object-title { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.object-title h1 { margin: 0; font-size: 1.5rem; flex: 1; }
.object-description { color: #4a453c; }
.fav-form { margin: 0; }
.fav-btn {
    background: none;
    border: none;
    color: #b8a888;
    padding: 0.2rem;
}
.fav-btn svg { width: 1.8rem; height: 1.8rem; }
.fav-btn.is-fav { color: #d99c1f; }
.primary-btn {
    display: block;
    text-align: center;
    background: #8a6d3b;
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    padding: 0.7rem;
    border-radius: 12px;
    margin-top: 1.2rem;
}

/* --- Karten-Listen (Chats, Favoriten) --- */
.card-list { list-style: none; padding: 0; margin: 0; }
.card-list li { margin-bottom: 0.6rem; }
.card-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #fff;
    border: 1px solid #ddd5c4;
    border-radius: 12px;
    padding: 0.5rem 0.7rem;
    text-decoration: none;
    color: inherit;
}
.card-link img, .thumb-placeholder {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d8c9a3;
    color: #4a3d24;
    font-weight: 700;
}
.card-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.card-text small { color: #6f675c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Karte --- */
.map-head h1 { margin-bottom: 0.4rem; }
.map-pager { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.map-pager a {
    padding: 0.25rem 0.8rem;
    border: 1px solid #8a6d3b;
    border-radius: 999px;
    text-decoration: none;
    color: #5c4726;
    background: #fdfbf6;
    font-size: 0.9rem;
}
.map-pager a.active { background: #8a6d3b; color: #fff; }
.map-canvas { position: relative; }
.map-canvas img {
    width: 100%;
    display: block;
    border-radius: 12px;
    border: 1px solid #ddd5c4;
}
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8a6d3b;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    cursor: pointer;
}
.map-marker.preview { background: #b0554a; }
.map-marker.icon-emoji { background: #fff; color: inherit; font-size: 1.1rem; }
.map-marker.icon-image { padding: 0; overflow: hidden; background: #fff; }
.map-marker.icon-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-marker-form { position: absolute; transform: translate(-50%, -50%); margin: 0; }
.map-marker-form .map-marker { position: static; transform: none; }

/* --- Chat-Bilder --- */
.bubble-image {
    display: block;
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 0.4rem;
}
.chat-head-link { display: flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; }

/* --- Einstellungen / Admin-Ergänzungen --- */
.active-choice { outline: 2px solid #8a6d3b; }
.admin-link { margin-top: 3rem; }
.admin-link a { color: #a09a8e; font-size: 0.9rem; }
.stack-form { display: flex; flex-direction: column; gap: 0.6rem; max-width: 480px; }
.stack-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.stack-form input[type=text], .stack-form textarea { padding: 0.4rem; }
.stack-form button { align-self: flex-start; }
.admin-thumb { max-width: 200px; border-radius: 8px; display: block; }
.admin-thumb.small { max-width: 60px; max-height: 60px; object-fit: cover; display: inline-block; vertical-align: middle; margin-right: 0.4rem; }
.answer-text { flex: 1; min-width: 0; }
.edit-form { display: flex; flex: 1; gap: 0.3rem; align-items: center; margin: 0; min-width: 0; flex-wrap: wrap; }
.hook-row { display: flex; gap: 0.3rem; flex: 1 1 100%; align-items: center; }
.hook-row input[type=url] { flex: 1; min-width: 180px; padding: 0.35rem; font-size: 0.85em; }
.answer-edit input[type=text] { flex: 1 1 60%; }
.edit-form input[type=text] { flex: 1; min-width: 140px; padding: 0.35rem; }
.edit-form .topic-label { font-weight: 700; }
.item-list li { flex-wrap: wrap; }
.answer-actions { display: flex; gap: 0.3rem; align-items: center; flex-shrink: 0; }
.answer-actions input[type=file] { max-width: 150px; font-size: 0.75rem; }

button { cursor: pointer; }
button.danger { border: 1px solid #b0554a; background: #fbe3e0; color: #7a2318; border-radius: 6px; }
