:root {
  --accent: #0b6e4f;
  --accent-dark: #095a41;
  --ink: #1d1d1f;
  --muted: #666;
  --line: #e4e4e7;
  --bg: #f7f7f8;
  --card: #fff;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); }
h1 { font-size: 26px; margin: 8px 0 12px; }

.container { max-width: 960px; margin: 0 auto; padding: 16px; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.btn {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn-alt { background: #25d366; border-color: #25d366; color: #073b1f; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); border-color: var(--danger); }

input, select, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9c9cf;
  border-radius: 6px;
}
textarea { resize: vertical; }
label { display: block; margin-bottom: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }

.search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.search input { flex: 2 1 220px; width: auto; }
.search select { flex: 1 1 160px; width: auto; }
.search .btn { flex: 0 0 auto; }

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

.listings { list-style: none; margin: 0; padding: 0; }
.listing {
  display: flex;
  gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.thumb {
  flex: 0 0 110px;
  width: 110px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: #eee;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.title { font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none; }
.title:hover { text-decoration: underline; }
.price { font-weight: 700; margin: 2px 0; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pager a {
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}
.pager a.current { background: var(--accent); border-color: var(--accent); color: #fff; }

.ad {
  display: grid;
  gap: 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ad-photo img { width: 100%; border-radius: 8px; }
.description { white-space: normal; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
@media (min-width: 720px) {
  .ad { grid-template-columns: 1.2fr 1fr; }
}

.form {
  max-width: 640px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.narrow { max-width: 360px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.inline { display: inline; margin: 0; }
.copy { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

.flash {
  padding: 10px 12px;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 6px;
}
.errors {
  padding: 10px 10px 10px 30px;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 6px;
  color: var(--danger);
}
.success {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hp { position: absolute; left: -9999px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.admin-top { display: flex; justify-content: space-between; align-items: center; }

.site-footer { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer .footer-cats a { margin: 0 6px; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.cats a {
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}
.cats a:hover { border-color: var(--accent); }
