:root {
  --bg: #ffffff; --fg: #222226; --muted: #7a7a84; --line: #e6e6ea; --soft: #f6f6f8;
  --btn: #55606e; --btn-fg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151517; --fg: #dcdce0; --muted: #86868f; --line: #2b2b30; --soft: #1b1b1e; --btn: #8590a0; --btn-fg: #151517; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); }
main { max-width: 760px; margin: 0 auto; padding: 40px 16px 24px; display: flex; flex-direction: column; gap: 32px; }

h1 { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.tag { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.notice { margin: 0; padding: 10px 12px; background: var(--soft); border-radius: 8px; color: var(--muted); font-size: .9rem; }

/* Suche */
.search { display: flex; flex-direction: column; gap: 16px; }
.controls { display: flex; flex-direction: column; gap: 16px; }
.selects { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .selects { grid-template-columns: repeat(3, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.label { font-size: .85rem; color: var(--muted); padding: 0; }
.row { display: flex; gap: 8px; }

button, .actions a { font: inherit; cursor: pointer; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-fg); text-decoration: none; text-align: center; }
button.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
button.ghost[aria-pressed=true] { background: var(--soft); border-color: var(--muted); }
button.small { padding: 6px 12px; font-size: .88rem; }
:is(button, select, input, a):focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
input[type=search], select { width: 100%; min-width: 0; padding: 10px 12px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input[type=search]:focus, select:focus { border-color: var(--muted); }
select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }


/* Ergebnisse */
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.head-actions { display: flex; gap: 8px; }
#status { margin: 12px 0; min-height: 1.5rem; color: var(--muted); font-size: .9rem; }
.grid { columns: 2 140px; column-gap: 8px; }
@media (min-width: 600px) { .grid { columns: 3 150px; } }
@media (min-width: 900px) { .grid { columns: 4 160px; } }
.tile { position: relative; margin: 0 0 8px; break-inside: avoid; border-radius: 8px; overflow: hidden; background: var(--soft); }
.tile-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: none; }
.tile-open img { display: block; width: 100%; height: auto; }
.fav { position: absolute; top: 6px; right: 6px; padding: 3px 9px; border-radius: 999px; border: 0; background: rgb(20 20 22 / .6); color: #f2f2f4; font-size: .78rem; }
.fav[aria-pressed=true] { background: rgb(240 240 244 / .9); color: #222226; }
.more { display: block; width: 100%; margin-top: 12px; background: transparent; color: var(--fg); border-color: var(--line); }

/* Großansicht */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 16px; width: min(94vw, 540px); background: var(--bg); color: var(--fg); }
dialog::backdrop { background: rgb(0 0 0 / .55); }
dialog img { display: block; max-width: 100%; max-height: 55vh; margin: 0 auto; border-radius: 8px; }
.pos { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.nav button:disabled { opacity: .35; cursor: default; }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 32px; }
