/* Social Hub — dunkles Werkzeug-Design mit klarer Hierarchie */
:root {
  --bg: #101418;
  --surface: #1a2027;
  --surface-2: #232b34;
  --border: #2e3944;
  --text: #e8edf2;
  --muted: #8b98a5;
  --accent: #4da3ff;
  --accent-strong: #1f7ae0;
  --ok: #3ecf8e;
  --err: #ff6b6b;
  --fb: #1877f2;
  --ig: #d6409f;
  --li: #0a66c2;
  --radius: 10px;
  --space: clamp(1rem, 0.8rem + 1vw, 2rem);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
main { max-width: 860px; margin: 0 auto; padding: var(--space); }

/* Kopfleiste */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.7rem var(--space);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-weight: 700; letter-spacing: 0.04em; }
.topbar nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.topbar nav a {
  color: var(--muted); text-decoration: none;
  padding: 0.35rem 0.7rem; border-radius: 6px;
  transition: background 150ms, color 150ms;
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar nav a.active { color: var(--text); background: var(--surface-2); }
.logout-form { margin: 0; }

/* Karten & Formulare */
.card, .auth-card, .empty-hint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.auth-card { max-width: 400px; margin: 12vh auto 0; }
.auth-card h1 { margin-top: 0; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; gap: 1rem; }
.muted { color: var(--muted); }
label { display: block; margin: 0.8rem 0; font-weight: 500; }
input[type=text], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%; margin-top: 0.3rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.55rem 0.7rem; font: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 0;
  border-color: var(--accent);
}
input[type=file] { margin-top: 0.4rem; color: var(--muted); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 1rem 0; padding: 0.6rem 1rem 0.9rem; }
legend { padding: 0 0.4rem; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0.45rem 0; }
.check input { width: auto; margin: 0; }
.schedule-row { display: none; margin-top: 0.4rem; }
.schedule-row.visible { display: block; }
.input-small { width: auto; }

/* Buttons */
button, .btn-ghost, .btn-primary, .btn-danger {
  font: inherit; cursor: pointer; text-decoration: none;
  border-radius: 6px; border: 1px solid transparent;
  padding: 0.5rem 1rem; display: inline-block;
  transition: background 150ms, border-color 150ms, transform 100ms;
}
button:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-strong); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: transparent; color: var(--err); border-color: transparent; }
.btn-danger:hover { border-color: var(--err); }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.85rem; }

/* Post-Karten */
.post-card {
  display: flex; gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem; margin-bottom: 0.9rem;
}
.post-card.status-geplant { border-left-color: var(--accent); }
.post-card.status-ok { border-left-color: var(--ok); opacity: 0.85; }
.post-card.status-fehler, .post-card.status-teilweise { border-left-color: var(--err); }
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.post-meta { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.post-text { margin: 0.3rem 0 0.6rem; white-space: pre-line; }
.post-error { color: var(--err); font-size: 0.88rem; margin: 0.2rem 0; }
.post-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.inline { display: inline; margin: 0; }
.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }

/* Chips */
.brand-chip, .chip {
  font-size: 0.78rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 99px;
}
.brand-chip { background: var(--surface-2); border: 1px solid var(--border); }
.chip-fb { background: color-mix(in srgb, var(--fb) 22%, transparent); color: #79b8ff; }
.chip-ig { background: color-mix(in srgb, var(--ig) 22%, transparent); color: #ff8ecf; }
.chip-na { background: color-mix(in srgb, var(--ig) 14%, transparent); color: #ffb3dc; border: 1px dashed color-mix(in srgb, var(--ig) 45%, transparent); }
.chip-li { background: color-mix(in srgb, var(--li) 25%, transparent); color: #6db3f2; }
.chip-done { outline: 1px solid var(--ok); }
.chip-fail { outline: 1px solid var(--err); }

/* Tabellen, Code, Meldungen */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { color: var(--muted); font-weight: 600; }
.code-block {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.8rem; overflow-x: auto; font-size: 0.85rem; user-select: all;
}
.flash { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.flash-err { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
ol li { margin-bottom: 0.5rem; }

video.thumb { background: #000; }

/* Bild-Studio */
.studio-preview {
  width: 100%;
  max-width: 440px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 0.8rem;
}

/* Vorlagen */
.tpl-group { font-size: 0.95rem; color: var(--muted); margin: 1.4rem 0 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.tpl-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.tpl-text {
  margin: 0.3rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Handy-Ansicht */
@media (max-width: 560px) {
  body { font-size: 15px; }
  main { padding: 0.9rem; padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  .topbar {
    padding: 0.5rem 0.9rem;
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .topbar nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .topbar nav a { white-space: nowrap; padding: 0.45rem 0.65rem; }
  .logout-form button { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
  .post-card { flex-direction: column; padding: 0.85rem; }
  .thumb { width: 100%; height: auto; max-height: 260px; }
  video.thumb { height: 220px; }
  .post-meta { margin-left: 0; width: 100%; }
  /* Touch-Ziele gross genug */
  .btn-small { padding: 0.5rem 0.85rem; }
  .post-actions { gap: 0.5rem; }
  .page-head { flex-wrap: wrap; }
  .card, .auth-card, .empty-hint { padding: 1rem; }
  .auth-card { margin-top: 8vh; }
  .code-block { font-size: 0.75rem; }
  .table { display: block; overflow-x: auto; }
}
