:root {
  --bg: #faf9f6;
  --text: #2b2b28;
  --muted: #6b6b64;
  --accent: #2f6b45;
  --accent-dark: #2d5a34;
  --border: #ddd8cd;
  --card-bg: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1, h2 {
  font-family: 'Fraunces', 'Georgia', serif;
}

.redaktion-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.redaktion-logo {
  font-family: 'Fraunces', 'Georgia', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-dark);
  text-decoration: none;
  letter-spacing: -.02em;
}

.redaktion-logo .logo-tld {
  color: var(--accent);
}

.redaktion-kicker {
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 0.6rem;
}

.redaktion-logout {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.redaktion-logout:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.wrap {
  max-width: 30rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.wrap.wide {
  max-width: 42rem;
}

.welcome-block {
  margin-bottom: 1.5rem;
}

.welcome-block h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  color: var(--accent-dark);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.action-card:hover {
  border-color: var(--accent);
}

.action-card svg {
  color: var(--accent);
}

.action-card-primary {
  background: #eef3ea;
  border-color: var(--accent);
}

.action-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.action-desc {
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-section h2 {
  font-size: 1.05rem;
  color: var(--accent-dark);
  margin: 0 0 0.75rem;
}


.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

p {
  color: var(--muted);
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input[type="email"],
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
}

select[multiple] {
  padding: 0.3rem;
}

button {
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

button.secondary,
a.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

a.secondary {
  display: inline-block;
  text-decoration: none;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
}

a.secondary:hover {
  opacity: 0.92;
}

.button-row {
  display: flex;
  gap: 0.75rem;
}

.button-row button {
  width: auto;
  flex: 1;
}

.beitraege-liste {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.beitraege-liste li {
  border-top: 1px solid var(--border);
  padding: 0.9rem 0;
}

.beitraege-liste li:first-child {
  border-top: none;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.78rem;
  margin-left: 0.4rem;
}

.status-entwurf {
  background: #eee;
  color: #555;
}

.status-eingereicht {
  background: #fff4e5;
  color: #8a5a00;
}

.status-freigegeben {
  background: #eaf5ec;
  color: var(--accent);
}

.status-abgelehnt {
  background: #fbe9e7;
  color: #9c3a2e;
}

.ablehnung {
  color: #9c3a2e;
  font-size: 0.9rem;
}

.markdown-preview {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #faf9f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.markdown-preview.rendered {
  white-space: normal;
  font-family: inherit;
  font-size: 1rem;
}

.markdown-preview.rendered h1,
.markdown-preview.rendered h2,
.markdown-preview.rendered h3 {
  margin-top: 0;
}

.markdown-preview.rendered ul,
.markdown-preview.rendered ol {
  padding-left: 1.4rem;
}

.ablehnen-form {
  margin-top: 0.75rem;
}

.inline-form {
  display: inline;
}

.allowlist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.allowlist-item span:first-child {
  color: var(--text);
}

button.small,
a.small {
  width: auto;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
}

.flash {
  background: #fff4e5;
  border: 1px solid #f0c987;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  background: #eef3ea;
  color: var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
}

a {
  color: var(--accent);
}

/* Lebensmittel-Picker (Beitrags-Editor) */
.food-picker {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  margin-bottom: 0.4rem;
  background: #fff;
}

.food-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.food-picker-chips:empty {
  display: none;
}

.food-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eef3ea;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
  font-size: 0.88rem;
}

.food-chip-remove {
  width: 1.6rem;
  height: 1.6rem;
  min-height: auto;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--accent-dark);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.food-picker-search {
  margin-bottom: 0 !important;
}

.food-picker-results {
  margin-top: 0.5rem;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.food-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--text);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
  font-size: 0.95rem;
}

.food-picker-item:last-child {
  border-bottom: none;
}

.food-picker-item:hover {
  background: #f4f2ec;
}

/* Profil: Foto-Vorschau + Link-Zeilen */
.profil-foto-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.profil-foto-preview img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

input[type="file"] {
  width: 100%;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.link-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.link-row select,
.link-row input {
  margin-bottom: 0;
}

.link-platform-select {
  flex: 0 0 9rem;
}

.link-custom-label {
  flex: 1 1 8rem;
}

.link-row input[type="url"] {
  flex: 2 1 12rem;
}

.link-row .link-row-remove {
  width: auto;
  flex: 0 0 auto;
}

.link-url-status {
  flex: 0 0 auto;
  width: 1.2rem;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.link-url-status.is-visible {
  opacity: 1;
}

@media (max-width: 40rem) {
  .link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .link-platform-select,
  .link-custom-label,
  .link-row input[type="url"] {
    flex: 1 1 auto;
  }
}

.profil-submit-row {
  margin-top: 1.25rem;
}

/* Profil: Persoenliche Abschnitte */
.abschnitt-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.abschnitt-row {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
}

.abschnitt-row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.abschnitt-row-head select,
.abschnitt-row-head input {
  margin-bottom: 0;
}

.abschnitt-vorlage-select {
  flex: 0 0 16rem;
}

.abschnitt-ueberschrift-custom {
  flex: 1 1 12rem;
}

.abschnitt-row-head .abschnitt-row-remove {
  width: auto;
  flex: 0 0 auto;
  margin-left: auto;
}

.abschnitt-row .food-picker {
  margin-bottom: 0.6rem;
}

.abschnitt-inhalt-text {
  margin-bottom: 0;
}

@media (max-width: 40rem) {
  .abschnitt-row-head {
    flex-direction: column;
    align-items: stretch;
  }

  .abschnitt-vorlage-select,
  .abschnitt-ueberschrift-custom {
    flex: 1 1 auto;
  }

  .abschnitt-row-head .abschnitt-row-remove {
    margin-left: 0;
  }
}
