:root { --ink: #222; --muted: #6b6b6b; --line: #ddd; --bg: #f7f5f0; --card: #fff; --accent: #2b5d8c; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--ink); background: var(--bg); }
header.top { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.2rem; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; } .brand span { color: var(--accent); font-weight: 400; }
nav a { margin-left: 1rem; } .who { color: var(--muted); }
main { max-width: 1100px; margin: 1.2rem auto; padding: 0 1rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; } h2 { font-size: 1.15rem; margin: .2rem 0 .6rem; }
.muted { color: var(--muted); }
label { display: block; margin: .6rem 0; } label input[type=text], label input:not([type]), label textarea, label select { display: block; width: 100%; max-width: 640px; padding: .45rem .55rem; border: 1px solid #bbb; border-radius: 6px; font: inherit; margin-top: .25rem; }
label.check { display: flex; gap: .5rem; align-items: flex-start; }
.btn { display: inline-block; padding: .45rem .9rem; border: 1px solid #999; border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; font: inherit; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.status { margin-left: .8rem; color: var(--muted); }
ul.sets { list-style: none; padding: 0; } ul.sets li { padding: .4rem 0; border-bottom: 1px solid var(--line); } ul.sets li span { margin-left: .6rem; }
.actions { margin-top: .8rem; }
.log { background: #111; color: #ddd; padding: .7rem; border-radius: 6px; font-size: .82rem; max-height: 260px; overflow: auto; white-space: pre-wrap; }

table.rows { width: 100%; border-collapse: collapse; margin-top: .8rem; font-size: .9rem; }
table.rows th, table.rows td { border-bottom: 1px solid var(--line); padding: .35rem .4rem; text-align: left; vertical-align: top; }
table.rows input, table.rows select { width: 100%; padding: .25rem .35rem; border: 1px solid #bbb; border-radius: 4px; font: inherit; font-size: .85rem; }
table.rows img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; background: #eee; }
.st-ok { color: #1a7f37; } .st-bad { color: #b42318; } .st-skip { color: #8a6d00; } .st-wait { color: var(--muted); }
.progress { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-top: .3rem; } .progress i { display: block; height: 100%; width: 0; background: var(--accent); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.tile { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
form.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
form.inline input { padding: .45rem .55rem; border: 1px solid #bbb; border-radius: 6px; font: inherit; }
.tile .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee; display: block; }
.tile .nothumb { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); background: #f0ede6; }
.tile .body { padding: .5rem .6rem; font-size: .88rem; } .tile .body b { display: block; } .tile .body .sp { font-style: italic; }
.tile .foot { display: flex; gap: .4rem; padding: .4rem .6rem .6rem; }
.species-head { grid-column: 1 / -1; margin: .6rem 0 -.3rem; font-style: italic; color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal[hidden], [hidden] { display: none !important; }
.modal-box { background: #fff; border-radius: 8px; width: min(96vw, 1000px); padding: .6rem; }
.modal-box.narrow { width: min(96vw, 560px); padding: .6rem 1rem 1rem; }
.tile .foot { flex-wrap: wrap; }
.modal-bar { display: flex; justify-content: space-between; align-items: center; padding: .2rem .3rem .5rem; }
.viewer { width: 100%; height: min(70vh, 700px); background: #e9e6df; border-radius: 6px; }
