:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #1f232c;
  --text: #e7eaf0;
  --text-2: #aab0bb;
  --text-3: #6b7280;
  --accent: #6aa9ff;
  --accent-hover: #4d8eef;
  --danger: #e07178;
  --ok: #7bd389;
  --border: #2a2f3a;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Charter", "Iowan Old Style", "Georgia", "Cambria", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.topbar nav { display: flex; gap: 14px; align-items: center; font-size: 13.5px; }
.topbar .who { color: var(--text-3); }

main { padding: 28px 22px 60px; }

.ressort-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  position: sticky;
  top: 45px;
  z-index: 9;
}
.ressort-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ressort-group__label {
  color: var(--text-3);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  padding-right: 4px;
  border-right: 1px solid var(--border);
  margin-right: 2px;
}
.ressort-link {
  color: var(--text-2);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.ressort-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.centered {
  max-width: 540px;
  margin: 60px auto 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card h1 { margin: 0 0 4px; font-size: 20px; }
.card h2 { margin: 0 0 6px; font-size: 16px; }
.card h3 { margin: 14px 0 6px; font-size: 14px; color: var(--text-2); }
.card .hint { font-size: 12.5px; color: var(--text-3); margin: 0; }

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}
label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}

input[type="email"], input[type="password"], input[type="url"], input[type="text"], textarea {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
}
textarea { font-family: ui-monospace, "JetBrains Mono", "Cascadia Mono", monospace; font-size: 12px; min-height: 100px; }

input:focus, textarea:focus { border-color: var(--accent); }

button {
  background: var(--accent);
  color: #0b1120;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  align-self: flex-start;
}
button:hover { background: var(--accent-hover); }
button.danger { background: var(--danger); color: #0b0707; }
button.link-btn {
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 500;
}
button.link-btn:hover { color: var(--accent-hover); background: transparent; }

.err {
  background: rgba(224, 113, 120, 0.1);
  border: 1px solid rgba(224, 113, 120, 0.35);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12.5px;
}
.ok {
  background: rgba(123, 211, 137, 0.1);
  border: 1px solid rgba(123, 211, 137, 0.35);
  color: var(--ok);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12.5px;
}

/* feed */
.feed {
  max-width: 1180px;
  margin: 0 auto;
}
.feed__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 22px;
}
.feed__header h1 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0;
}
.feed__home { font-size: 13px; }
.feed .hint {
  text-align: center;
  color: var(--text-3);
  margin-top: 60px;
}
.section { margin-bottom: 36px; }
.section__title {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section__title a {
  color: var(--text);
  text-decoration: none;
}
.section__title a:hover {
  color: var(--accent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.card__img {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.card__img--blank { background: var(--surface-2); }
.card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card__cat { color: var(--accent); font-weight: 600; }
.card__catch {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}
.card__title {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.3;
  color: var(--text);
}

/* article */
.reader {
  max-width: 720px;
  margin: 20px auto;
  padding: 0 6px;
}
.reader h1 {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.18;
  margin: 8px 0 14px;
}
.reader .meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 0;
}
.reader .meta .badge {
  display: inline-block;
  padding: 2px 7px;
  background: var(--accent);
  color: #0b1120;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.reader .meta .orig { margin-left: auto; }
.reader .lede {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--text-2);
  margin: 4px 0 18px;
  line-height: 1.4;
}
.reader .cover {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 4px 0 22px;
}
.reader .body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
}
.reader .body p { margin: 0 0 18px; }
.reader .body h2 { font-family: var(--serif); font-size: 22px; margin: 28px 0 10px; }
.reader .body h3 { font-family: var(--serif); font-size: 18px; margin: 22px 0 8px; }
.reader .body img { max-width: 100%; height: auto; border-radius: 6px; margin: 12px 0; }
.reader .body figure { margin: 14px 0; }
.reader .body figcaption { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.reader .body blockquote {
  border-left: 3px solid var(--accent);
  margin: 16px 0;
  padding: 4px 14px;
  color: var(--text-2);
  font-style: italic;
}
.reader .back { margin-top: 36px; font-size: 13px; }

/* admin */
.admin {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.admin h1 { margin: 0; font-size: 22px; }

table.users {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.users th, table.users td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
table.users th { color: var(--text-3); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions details summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.row-actions form.inline { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; }
.row-actions form.inline input { font-size: 12px; padding: 5px 8px; }
.row-actions form.inline button { padding: 5px 10px; font-size: 12px; }

form.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
form.row input { flex: 1; min-width: 140px; }
