:root {
    --bg: #ffffff;
    --ink: #000000;
    --muted: #737373;
    --line: #e5e5e5;
    --soft: #f4f4f4;
    --radius: 10px;
    --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 var(--sans);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, .btn, .chip, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
h2 small { font-size: .9rem; color: var(--muted); font-weight: 400; margin-left: .35em; letter-spacing: 0; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 72px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -.03em; }
.logo-mark { width: 22px; height: 22px; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav > a:not(.btn) { text-decoration: none; font-size: .95rem; color: var(--muted); }
.nav > a:not(.btn):hover { color: var(--ink); }
.nav-me { display: flex; align-items: center; gap: 8px; }
.nav-me img { border-radius: 50%; width: 28px; height: 28px; object-fit: cover; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45em;
    padding: .7em 1.25em; border-radius: 999px; border: 1px solid var(--ink);
    background: var(--ink); color: var(--bg); font: 600 .9rem/1.1 var(--sans);
    text-decoration: none; cursor: pointer; white-space: nowrap; transition: opacity .15s, background .15s, color .15s;
}
.btn:hover { opacity: .82; }
.btn-small { padding: .55em 1em; font-size: .85rem; }
.btn-ghost, .btn-like, .btn-danger { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover, .btn-like:hover, .btn-danger:hover { opacity: 1; border-color: var(--ink); }
.btn-like.is-liked { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-like.is-liked .icon { fill: currentColor; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; }
.actions form { margin: 0; }

/* Flash */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 24px; background: var(--soft); font-size: .95rem; }
.flash-error { background: var(--ink); color: var(--bg); }

/* Hero */
.hero { padding: 32px 0 40px; max-width: 680px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.04em; line-height: 1.05; }
.hero p { font-size: 1.1rem; color: var(--muted); margin: 0 0 28px; max-width: 540px; }

/* Formulare */
.search { display: flex; gap: 8px; margin-bottom: 20px; }
.search input { flex: 1; min-width: 0; }
input[type=search], input[type=text], textarea {
    width: 100%; padding: .75em 1.1em; border: 1px solid var(--line); border-radius: 999px;
    background: var(--bg); color: var(--ink); font: inherit; -webkit-appearance: none; appearance: none;
}
textarea { border-radius: var(--radius); resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); }
::placeholder { color: #a3a3a3; }
label { display: block; font-weight: 600; margin: 20px 0 8px; font-size: .95rem; }

/* Chips */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-block; padding: .4em .9em; border-radius: 999px; background: var(--bg);
    border: 1px solid var(--line); text-decoration: none; font: .85rem/1.3 var(--sans); color: var(--ink); cursor: pointer;
}
.chip small { color: var(--muted); margin-left: 3px; }
a.chip:hover, button.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.is-active small { color: inherit; opacity: .6; }
.chips-small { gap: 4px; margin: 8px 0 0; }
.chips-small .chip { font-size: .75rem; padding: .2em .65em; background: var(--soft); border-color: transparent; }
.category-cloud { margin-bottom: 40px; }

/* Liste */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.list-head h2 { margin: 0; }
.sort { display: flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 999px; }
.sort a { text-decoration: none; padding: .3em .95em; border-radius: 999px; font-size: .85rem; color: var(--muted); }
.sort a.is-active { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px 20px; }

.card { display: flex; flex-direction: column; min-width: 0; }
.card-cover { aspect-ratio: 1; background: var(--soft); display: block; border-radius: var(--radius); overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
@media (hover: hover) { .card:hover .card-cover img { transform: scale(1.03); } }
.card-body { padding-top: 10px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1rem; margin: 0 0 2px; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { text-decoration: none; }
.card-meta { margin: 0; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .chips-small { flex-wrap: nowrap; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.card .chips-small li { flex: none; }
.card-stats { margin: auto 0 0; padding-top: 8px; display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.card-stats span { display: inline-flex; align-items: center; gap: 4px; }
.cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c4c4c4; }
.cover-empty .icon { width: 36%; height: 36%; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 48px; color: var(--muted); font-size: .9rem; }
.empty { text-align: center; padding: 56px 16px; background: var(--soft); border-radius: var(--radius); color: var(--muted); }
.empty p { margin: 0 0 18px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.back:hover { color: var(--ink); }

/* Profil */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.profile-head > div { flex: 1; min-width: 200px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 4px 0 0; font-size: .95rem; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.hint { background: var(--soft); padding: 14px 18px; border-radius: var(--radius); margin: 0 0 28px; font-size: .95rem; color: #404040; }
.my-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.my-item { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.my-cover { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; flex: none; background: var(--soft); }
.my-cover img { width: 100%; height: 100%; object-fit: cover; }
.my-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.my-info strong { overflow-wrap: anywhere; font-weight: 600; }
.my-info .muted { font-size: .85rem; }
.my-item .chips-small { margin: 4px 0; }
.my-item.is-listed .my-info strong::after { content: "Veröffentlicht"; margin-left: 8px; font-size: .7rem; font-weight: 600; padding: .15em .55em; border-radius: 999px; background: var(--ink); color: var(--bg); vertical-align: .15em; }

/* Bearbeiten & Detail */
.edit, .detail { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; }
.edit-cover, .detail-cover { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--soft); }
.edit-cover img, .detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { overflow-wrap: anywhere; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.desc { max-width: 600px; color: #404040; }
.detail-info .chips { margin-top: 16px; }
.embed { margin: 48px 0; }
.embed iframe { border-radius: var(--radius); display: block; }
.embed-consent { background: var(--soft); border-radius: var(--radius); padding: 32px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.embed-consent p { margin: 0 0 16px; }

/* Kommentare (Sheet) */
.sheet { margin: 0 0 0 auto; padding: 0; border: 0; height: 100%; max-height: 100%; width: 440px; max-width: 100%; background: var(--bg); color: var(--ink); box-shadow: -24px 0 64px -24px rgba(0, 0, 0, .3); }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in-right .25s cubic-bezier(.2, .8, .2, 1); }
.sheet.is-closing { animation: sheet-out-right .2s ease-in forwards; }
.sheet::backdrop { background: rgba(0, 0, 0, .35); }
@keyframes sheet-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes sheet-out-right { to { transform: translateX(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sheet-close .icon { width: 18px; height: 18px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 20px; overscroll-behavior: contain; }
.sheet-empty { padding: 24px 0; }
.sheet-foot { flex: none; border-top: 1px solid var(--line); padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
.sheet-foot > .btn { width: 100%; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-empty { background: var(--soft); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; }
.comment-body { flex: 1; min-width: 0; }
.comment-body p { margin: 0 0 4px; overflow-wrap: anywhere; }
.comment-head { font-size: .95rem; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { flex: 1; border-radius: 20px; padding: .6em 1em; min-height: 44px; max-height: 140px; }
.comment-form .btn { flex: none; }
.inline { display: inline; }
.btn-ghost .icon, .btn-like .icon { width: 1.1em; height: 1.1em; }
@media (max-width: 600px) {
    .sheet { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; box-shadow: none; }
    .sheet[open] { animation-name: sheet-in-up; }
    .sheet.is-closing { animation-name: sheet-out-down; }
    @keyframes sheet-in-up { from { transform: translateY(100%); } to { transform: none; } }
    @keyframes sheet-out-down { to { transform: translateY(100%); } }
    .sheet-head { padding: 12px 16px; }
    .sheet-body { padding: 0 16px; }
    .sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}

/* Rechtstexte */
.prose { max-width: 680px; }
.prose h2 { margin-top: 1.8em; font-size: 1.15rem; }
.prose p { color: #404040; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: .8rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }

/* Mobil */
.hide-xs { display: inline; }
@media (max-width: 720px) {
    .edit, .detail { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
    .hide-xs { display: none; }
    .main { padding-top: 20px; padding-bottom: 48px; }
    .header-inner { height: 56px; }
    .nav { gap: 14px; }
    .nav-me span { display: none; }
    .hero { padding: 12px 0 28px; }
    .hero p { font-size: 1rem; }
    .hero .btn { width: 100%; }

    /* Kategorien als wischbare Zeile */
    .category-cloud { margin: 0 -16px 28px; }
    .category-cloud .chips {
        flex-wrap: nowrap; overflow-x: auto; padding: 2px 16px 4px;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .category-cloud .chips::-webkit-scrollbar { display: none; }
    .category-cloud li { flex: none; }

    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
    .card-title { font-size: .95rem; }
    .card-meta { font-size: .8rem; }

    .edit-cover, .detail-cover { width: 64%; max-width: 260px; margin: 0 auto; }
    .detail .actions > *, .edit .actions > * { flex: 1 1 calc(50% - 8px); }
    .detail .actions .btn, .edit .actions .btn { width: 100%; }
    .detail .actions > a:last-child:nth-child(odd) { flex-basis: 100%; }
    .embed { margin: 32px 0; }
    .link-btn { padding: 6px 0; }

    .profile-head { gap: 14px; }
    .profile-head .btn { width: 100%; }
    .avatar-lg { width: 56px; height: 56px; }
    .my-item { flex-wrap: wrap; gap: 12px; }
    .my-item .btn { width: 100%; }

    .footer-inner { flex-direction: column; gap: 6px; }
}

/* Popup */
.modal { border: 0; border-radius: 16px; padding: 28px; width: min(420px, calc(100% - 32px)); box-shadow: 0 24px 64px -12px rgba(0, 0, 0, .35); color: var(--ink); background: var(--bg); }
.modal::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal h2 { font-size: 1.5rem; margin-bottom: .3em; }
.modal p { margin: 0 0 18px; font-size: .95rem; }
.modal input { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 600px) { .modal-actions .btn { flex: 1; } }
.owner { color: var(--ink); font-weight: 600; }
a.owner { text-decoration: none; font-weight: 600; color: var(--ink); }
a.owner:hover, .handle:hover, .card-meta a:hover { text-decoration: underline; }
.handle, .card-meta a { text-decoration: none; }
.avatar-lg.avatar-empty { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex: none; }
.profile-head > .profile-actions { display: flex; gap: 8px; flex: none; min-width: 0; margin-left: auto; }
.btn-icon { padding: .7em; aspect-ratio: 1; }
.btn-icon .icon { width: 18px; height: 18px; }
@media (max-width: 600px) {
    .profile-actions { width: 100%; }
    .profile-actions .btn:first-child { flex: 1; }
    .profile-head .profile-actions .btn-icon { width: auto; }
}

/* Login-Zustimmung */
.login-page { max-width: 440px; margin: 24px auto; }
.login-form h2 { font-size: 1.5rem; margin-bottom: .3em; }
.login-form p { margin: 0 0 18px; font-size: .95rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; margin: 0 0 20px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

/* Cookie-Banner */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 560px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 16px 48px -12px rgba(0, 0, 0, .25); font-size: .9rem; }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 14px; color: #404040; }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 600px) { .consent-actions .btn { flex: 1; } }
.sheet:focus, .modal:focus, .sheet:focus-visible, .modal:focus-visible { outline: none; }
.comment-actions { display: flex; align-items: center; gap: 16px; margin-top: 2px; }
.comment-like { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; text-decoration: none; }
.comment-like .icon { width: 15px; height: 15px; }
.comment-like:hover { color: var(--ink); }
.comment-like.is-liked { color: var(--ink); }
.comment-like.is-liked .icon { fill: currentColor; }
.share { margin: 0 0 28px; }
.share label { margin-top: 0; }
.share .search { margin-bottom: 0; }
.my-info strong a, .my-cover { text-decoration: none; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding-left: 1.1em; background: var(--bg); }
.input-prefix:focus-within { border-color: var(--ink); }
.input-prefix span { color: var(--muted); }
.input-prefix input { border: 0; padding-left: .2em; margin: 0 !important; }
.modal label { margin: 14px 0 6px; }
.modal input { margin-bottom: 6px; }
.modal .small { margin: 6px 0 18px; }
input[type=email] { width: 100%; padding: .75em 1.1em; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; -webkit-appearance: none; appearance: none; margin-bottom: 16px; }
input[type=email]:focus { outline: none; border-color: var(--ink); }
.login-page h1 { font-size: 1.8rem; }
.share-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.share-head label { margin: 0; }
.info-btn { background: none; border: 0; padding: 4px; color: var(--muted); cursor: pointer; display: inline-flex; }
.info-btn:hover { color: var(--ink); }
.info-btn .icon { width: 17px; height: 17px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 18px 0 4px; }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; font-size: 1.4rem; font-weight: 600; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-edit-actions label.btn { margin: 0; font-weight: 600; }
.avatar-edit-actions [hidden] { display: none; }
.chip-more { font-weight: 600; border-color: var(--ink); }
h1 small { font-size: 1rem; font-weight: 400; letter-spacing: 0; }
.letter-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 28px; }
.letter-nav a { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--muted); }
.letter-nav a:hover { background: var(--soft); color: var(--ink); }
.letter-group { margin-bottom: 28px; }
.letter-group h2 { font-size: 1.1rem; margin-bottom: 10px; }
.all-cats-link { display: none; }
@media (max-width: 600px) {
    .all-cats-link { display: inline-block; margin: 6px 16px 0; font-size: .85rem; font-weight: 600; text-decoration: none; }
    .category-cloud .chip-more { display: none; }
}
.load-more { display: flex; justify-content: center; padding: 32px 0 8px; min-height: 40px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; opacity: 0; }
.load-more.is-loading .spinner { opacity: 1; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pager[hidden] { display: none; }
