:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #646b73;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --border: #e3e1da;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --card: #1e2126;
    --text: #e6e6e3;
    --muted: #9aa1a9;
    --accent: #58a6ff;
    --accent-text: #0b1420;
    --border: #2d3138;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.site-header, main, .site-footer, .admin {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}
.site-header { padding-top: 40px; }
.site-header h1 { font-size: 2.2rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.intro { color: var(--muted); max-width: 640px; }
.intro p { margin: 0 0 .6em; }
.count { color: var(--muted); font-size: .9rem; margin: 28px 0 10px; }
.empty { color: var(--muted); margin: 40px 0; }
ul.hefter { list-style: none; padding: 0; margin: 0 0 48px; display: grid; gap: 18px; }
.hefte {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.thumb {
  display: block;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb-ext {
  display: flex; height: 100%; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 600; letter-spacing: .05em;
}
.body h2 { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.3; }
.body h2 a { color: inherit; text-decoration: none; }
.body h2 a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.desc p { margin: 0 0 .7em; }
.actions { margin: 14px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
}
.btn.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.danger { background: transparent; color: #c0392b; border-color: #c0392b; }
.site-footer { color: var(--muted); font-size: .9rem; padding-bottom: 40px; }
@media (max-width: 560px) {
  .hefte { grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
  .site-header h1 { font-size: 1.8rem; }
}

/* admin */
.admin h1 { margin-top: 32px; }
.admin h1 a { color: var(--muted); font-size: .8rem; font-weight: normal; margin-left: 12px; }
.admin h2 { font-size: 1.15rem; margin: 36px 0 12px; }
.admin form.box {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px;
}
.admin label { display: block; font-weight: 600; margin: 14px 0 4px; }
.admin label:first-child { margin-top: 0; }
.admin label small { font-weight: normal; color: var(--muted); }
.admin input[type=text], .admin textarea {
  width: 100%; font: inherit; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.admin textarea { min-height: 140px; resize: vertical; }
.admin input[type=file] { font: inherit; }
.admin button {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-text);
  border: 1px solid transparent; border-radius: 8px; padding: 9px 18px; margin-top: 16px;
}
.admin button.small { padding: 4px 10px; margin: 0; font-size: .85rem; }
.admin button.danger { background: transparent; color: #c0392b; border-color: #c0392b; }
.msg { padding: 12px 16px; border-radius: 10px; margin: 20px 0; }
.msg.ok { background: #e3f6e8; color: #1b5e2f; }
.msg.err { background: #fde8e6; color: #8a1c12; }
table.list { width: 100%; border-collapse: collapse; margin-bottom: 48px; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-size: .85rem; color: var(--muted); font-weight: 600; }
table.list td.acts { white-space: nowrap; }
table.list td.acts form { display: inline; }
.current-file { color: var(--muted); font-size: .9rem; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
table.list td.order { white-space: nowrap; width: 1%; color: var(--muted); }
table.list td.order form { display: inline; }
table.list td.order .grip { cursor: grab; margin-right: 6px; user-select: none; letter-spacing: -3px; }
table.list tr[draggable] { cursor: default; }
table.list tr.dragging { opacity: .4; }
.admin button.small:disabled { opacity: .35; cursor: default; }
