[hidden] { display: none !important; }
:root {
  --bg: #f5f5f2; --card: #fff; --text: #17181a; --muted: #6a6d70; --line: #e3e2dd;
  --accent: #1f5135; --accent-hover: #173f29; --danger: #b42318; --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1 { font-size: 1.75rem; letter-spacing: -0.02em; margin: 0 0 16px; }
h2.section { font-size: 1.05rem; margin: 32px 0 12px; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
code { background: #ecebe6; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }

/* Leiste */
.bar { background: #15181b; color: #fff; display: flex; align-items: center; gap: 24px; padding: 0 20px; min-height: 58px; flex-wrap: wrap; }
.bar a { color: #d6d8da; text-decoration: none; }
.bar .logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.bar nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.bar nav a { padding: 8px 12px; border-radius: 6px; font-size: .95rem; }
.bar nav a:hover { background: #262a2e; color: #fff; }
.bar nav a.active { background: #2f3439; color: #fff; }
.bar-right { display: flex; gap: 16px; align-items: center; font-size: .9rem; }
.bar-right form { margin: 0; }
.bar .linklike { color: #d6d8da; }
@media (max-width: 760px) { .bar { padding: 10px 16px; gap: 8px; } .bar nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; } .bar-right { margin-left: auto; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .95rem;
  padding: 10px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #c9c7c0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: #f0c8c4; background: #fff; }
.btn.danger:hover { background: #fdf1f0; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.linklike.danger { color: var(--danger); }

/* Formulare */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 16px; }
label small { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; font-size: 1rem;
  padding: 10px 12px; border: 1px solid #cfcdc6; border-radius: 6px; background: #fff; color: var(--text);
}
textarea { resize: vertical; line-height: 1.55; min-height: 120px; }
textarea.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92rem; }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
label.check, label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 10px; }
label.inline { display: inline-flex; margin: 0 16px 0 0; }
input.num { width: 70px !important; display: inline-block !important; margin: 0 !important; padding: 6px 8px !important; }
fieldset { border: 0; padding: 0; margin: 4px 0 12px; }
legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.editor.narrow { max-width: 760px; }

/* Hinweise */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: #edf7f0; border-color: #b8dcc4; color: #18402a; }
.flash.err { background: #fdf1f0; border-color: #f2c4bf; color: #8a1c12; }
.flash.info { background: #eef3fb; border-color: #c4d4ee; color: #1d3a66; }
.flash.info a { font-weight: 600; }

/* Anmelden */
body.out { display: grid; place-items: start center; min-height: 100vh; }
.auth { width: 100%; max-width: 400px; margin-top: 12vh; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }

/* Listen */
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.head-row h1 { margin: 0; }
.crumb { margin: 0 0 8px; font-size: .9rem; } .crumb a { text-decoration: none; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 500; }
.tabs a span { font-size: .8rem; opacity: .75; }
.tabs a.active { background: var(--text); color: #fff; }
.search input { margin: 0 !important; width: 240px !important; padding: 8px 12px !important; }
.news-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.news-list li + li { border-top: 1px solid var(--line); }
.news-list .row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-decoration: none; color: inherit; }
.news-list .row:hover { background: #fafaf8; }
.thumb { width: 64px; height: 48px; flex: none; border-radius: 4px; background: #ecebe6; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: .86rem; }
.chev { color: #b0aea7; font-size: 1.4rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #ecebe6; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tag.draft { background: #fff3d6; color: #7a5300; }
.empty { color: var(--muted); padding: 32px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Editor */
.cols { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; margin-top: 16px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .col-side { order: -1; } }
.col-main input[name=title] { font-size: 1.2rem; font-weight: 600; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.panel.subtle { background: transparent; border-style: dashed; }
@media (min-width: 861px) { .col-side { position: sticky; top: 16px; } }
.help { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: -6px 0 16px; font-size: .9rem; }
.help summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.help table { border-collapse: collapse; margin: 10px 0; }
.help td { padding: 4px 16px 4px 0; vertical-align: top; }
.help pre { background: #ecebe6; padding: 10px; border-radius: 4px; font-size: .85rem; overflow-x: auto; }

.img-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.img-list li { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.img-list img { width: 120px; height: 90px; object-fit: cover; border-radius: 4px; flex: none; background: #ecebe6; }
.img-fields { flex: 1; min-width: 0; }
.img-fields label { margin-bottom: 8px; }
.img-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 0; font-size: .9rem; }
.danger { color: var(--danger); }
@media (max-width: 520px) { .img-list li { flex-direction: column; } .img-list img { width: 100%; height: 160px; } }

.dropzone { position: relative; border: 2px dashed #c9c7c0; border-radius: var(--radius); background: var(--card); padding: 26px; text-align: center; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: #f0f6f2; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone label { margin: 0; font-weight: 400; color: var(--muted); pointer-events: none; }
.dropzone label strong { color: var(--accent); }
.previews { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.previews:not(:empty) { margin-top: 14px; }
.previews img { width: 84px; height: 64px; object-fit: cover; border-radius: 4px; }
.new-cap { margin-top: 14px; }

/* Einstellungen */
.img-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.img-setting { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.img-setting .lbl { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.img-setting img { height: 120px; width: 100%; object-fit: cover; border-radius: 4px; margin-bottom: 10px; }
@media (max-width: 620px) { .img-settings { grid-template-columns: 1fr; } }

/* Dateien */
.upload-row { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 16px 0 20px; flex-wrap: wrap; }
.upload-row input { flex: 1; min-width: 200px; }
table.files { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .93rem; }
table.files th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.files td { padding: 10px 14px; border-bottom: 1px solid var(--line); word-break: break-all; }
table.files form { margin: 0; }
table.files td:last-child { width: 1%; white-space: nowrap; word-break: normal; text-align: right; }
code.copy { cursor: pointer; } code.copy:hover { background: #dfe9e2; }
code.copy.done::after { content: " ✓ kopiert"; color: var(--accent); font-family: var(--font); }
@media (max-width: 700px) {
  table.files thead { display: none; } table.files tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.files td { display: block; border: 0; padding: 3px 14px; } table.files td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); }
}

.log { list-style: none; padding: 0; font-size: .9rem; }
.log li { padding: 4px 0; } .log li.ok::before { content: "✓ "; color: var(--accent); } .log li.err { color: var(--danger); word-break: break-all; }

/* ===== Text-Editor (WYSIWYG) ===== */
.field { margin-bottom: 16px; }
.field-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.rte.on { border: 1px solid #cfcdc6; border-radius: 6px; background: #fff; overflow: hidden; }
.rte.on:focus-within { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.rte-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px; border-bottom: 1px solid var(--line); background: #fafaf8; position: sticky; top: 0; z-index: 2; }
.rte-toolbar button { width: 36px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--text); cursor: pointer; }
.rte-toolbar button svg { width: 19px; height: 19px; }
.rte-toolbar button:hover { background: #ecebe6; }
.rte-toolbar button[aria-pressed="true"] { background: #dfe9e2; color: var(--accent); }
.rte-toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.rte-toolbar select { width: auto !important; max-width: 220px; margin: 0 0 0 2px !important; padding: 6px 8px !important; font-size: .88rem !important; display: inline-block !important; }
.rte-area { min-height: 260px; max-height: 70vh; overflow-y: auto; padding: 14px 16px; font-size: 1rem; line-height: 1.6; outline: none; }
.rte-area.is-empty::before { content: attr(data-placeholder); color: #9a9a95; position: absolute; pointer-events: none; }
.rte-area > :first-child { margin-top: 0; }
.rte-area p { margin: 0 0 .8em; }
.rte-area h1, .rte-area h2, .rte-area h3, .rte-area h4 { font-size: 1.15rem; margin: 1.2em 0 .4em; letter-spacing: -0.01em; }
.rte-area ul, .rte-area ol { margin: 0 0 .8em; padding-left: 1.4em; }
.rte-area a { color: var(--accent); text-decoration: underline; cursor: text; }
.rte-hint { margin: 6px 0 0; }
@media (max-width: 520px) { .rte-toolbar select { max-width: 100%; flex-basis: 100%; margin: 4px 0 !important; order: 10; } .rte-toolbar .sep { display: none; } }
