:root {
  color-scheme: light dark;
  --bg: #f4f6f1;
  --surface: #fff;
  --text: #142922;
  --muted: #4d665d;
  --accent: #165948;
  --accent-text: #fff;
  --line: #cedbd2;
  --soft: #e7efe8;
  --error: #a02e28;
  font: 16px/1.5 system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111d19;
    --surface: #192b25;
    --text: #eaf3ed;
    --muted: #b0c9bd;
    --accent: #a4dbc5;
    --accent-text: #12352b;
    --line: #3d564b;
    --soft: #233c32;
    --error: #ffada4;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
.wrap { width: min(100% - 2rem, 66rem); margin-inline: auto; }
.top { background: #153e37; color: #fff; }
.top-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 750; letter-spacing: -.025em; font-size: 1.2rem; }
.brand img { border-radius: 11px; }
.top .quiet { background: transparent; color: #fff; border-color: #71958a; }
main { min-height: 66vh; padding-block: clamp(1.5rem, 5vw, 3rem); }
footer { border-top: 1px solid var(--line); padding-block: 1rem; font-size: .85rem; color: var(--muted); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -.055em; }
.intro p, .login-panel > p { margin-top: .65rem; color: var(--muted); }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.login-panel { max-width: 28rem; padding: clamp(1rem, 5vw, 2.4rem); margin-inline: auto; }
#login { display: grid; gap: .6rem; margin-top: 1.5rem; }
#login button { margin-top: .5rem; }
button, input, select { font: inherit; min-height: 44px; }
button, .button { cursor: pointer; font-weight: 650; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; }
button:disabled { cursor: default; opacity: .55; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.quiet, .button { background: var(--surface); color: var(--text); }
.button { display: inline-block; text-decoration: none; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.top button:focus-visible { outline-color: white; }
input:not([type=checkbox]), select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .5rem .65rem;
  color: var(--text);
  background: var(--bg);
}
label { font-weight: 600; }
.checkbox { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 450; }
.checkbox input { min-height: auto; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--accent); }
.error { color: var(--error); }
.error:empty { display: none; }
.segments { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--soft); border-radius: 12px; margin-block: 1.25rem .8rem; }
.segments button { border-color: transparent; color: var(--text); background: transparent; }
.segments [aria-pressed=true] { background: var(--accent); color: var(--accent-text); }
#clear-parent { display: block; margin-bottom: .8rem; }
.search { padding: clamp(.8rem, 3vw, 1.25rem); }
.search-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; margin-top: .35rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .4rem 1.1rem; margin-top: .75rem; }
.filters label:first-child { width: min(100%, 15rem); }
.filters select { display: block; margin-top: .25rem; }
.list-status { margin-block: 1rem .6rem; color: var(--muted); }
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: .65rem; }
.card { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: .75rem; padding: .85rem; align-items: start; }
.thumbnail { display: grid; place-items: center; width: 50px; height: 50px; background: var(--soft); border-radius: 10px; overflow: hidden; color: var(--accent); font-weight: 750; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 1.06rem; }
.card p, .metadata { color: var(--muted); font-size: .88rem; }
.card button { margin-top: .65rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1.25rem; }
dialog { color: var(--text); background: var(--surface); width: min(100% - 1.5rem, 36rem); max-height: 88vh; overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: clamp(.85rem, 4vw, 1.5rem); }
dialog::backdrop { background: #091b17b8; }
.detail-header { display: flex; justify-content: space-between; align-items: start; gap: .7rem; margin-bottom: .85rem; }
.detail-photo { display: block; max-width: 100%; max-height: 42vh; object-fit: contain; border-radius: 12px; margin-block: .75rem; }
.detail-description { margin-block: .6rem 1rem; white-space: pre-wrap; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
