:root {
  --paper: #f4f1ea; --card: #fff; --ink: #1f2a22; --muted: #6a7064; --line: #e3ddd0;
  --forest: #2f5d3a; --forest-dark: #1d3b25; --sun: #e9a23b; --flame: #c8502d;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 1rem/1.55 "Source Sans 3", system-ui, sans-serif; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--forest); }
h1, h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 8px 0 4px; }
.muted { color: var(--muted); }
code { background: #f1ede3; padding: 1px 5px; border-radius: 4px; font-size: .88em; }

/* Layout */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--forest-dark); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 22px; }
.side-brand span { font: 700 1.2rem "Fraunces", serif; line-height: 1.1; }
.side-brand small { display: block; font: 600 .72rem "Source Sans 3", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.on { background: rgba(233,162,59,.18); color: #fff; box-shadow: inset 3px 0 0 var(--sun); }
.badge { margin-left: auto; background: var(--sun); color: var(--ink); font-size: .75rem; border-radius: 999px; padding: 1px 8px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.side-foot a, .side-foot button { color: rgba(255,255,255,.75); text-decoration: none; padding: 8px 12px; border-radius: 8px; font: 600 .95rem "Source Sans 3", sans-serif; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.side-foot a:hover, .side-foot button:hover, .side-foot a.on { background: rgba(255,255,255,.07); color: #fff; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 22px 32px 6px; }
.topbar h1 { margin: 0; font-size: 1.8rem; }
.menu-btn { display: none; font-size: 1.4rem; background: none; border: 0; cursor: pointer; padding: 6px 10px; }
.inner { padding: 14px 32px 60px; max-width: 1100px; }

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: block; }
  .topbar { padding: 16px 16px 4px; }
  .topbar h1 { font-size: 1.4rem; }
  .inner { padding: 12px 16px 48px; }
}

/* Bausteine */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--forest); background: var(--forest); color: #fff; font: 700 .95rem "Source Sans 3", sans-serif; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--forest-dark); border-color: var(--forest-dark); color: #fff; }
.btn-light { background: #fff; color: var(--forest); }
.btn-light:hover { background: #eef3ea; color: var(--forest); }
.btn-danger { background: #fff; color: var(--flame); border-color: #ecc3b4; }
.btn-danger:hover { background: var(--flame); color: #fff; border-color: var(--flame); }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: #e3eedb; color: #234a2c; border: 1px solid #b9d3a9; }
.flash-error { background: #f8e1d8; color: #7a2a12; border: 1px solid #ecb7a3; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #efebe1; font-size: .8rem; font-weight: 700; color: var(--muted); }
.tag-ok { background: #e3eedb; color: #2d6a3a; }
.tag-sun { background: #fbe9c8; color: #8a5a10; }
.help { font-size: .88rem; color: var(--muted); margin: -6px 0 0; }

/* Übersicht */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); }
.stat b { display: block; font: 600 2.1rem/1 "Fraunces", serif; color: var(--forest); margin-bottom: 4px; }
.stat span { color: var(--muted); font-weight: 600; }
.stat.hot { border-color: var(--sun); background: #fffaf0; }
.stat.hot b { color: var(--flame); }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border: 0; }
.date { display: inline-block; min-width: 92px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--flame); margin-right: 8px; vertical-align: 1px; }

/* Tabellen */
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); }
td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #faf8f3; }
td a { text-decoration: none; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.dim { opacity: .55; }
.unread td { background: #fffaf0; }
.clip { color: var(--muted); }

/* Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--forest); }
.card img, .card .avatar { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex: none; }
.card .avatar { display: grid; place-items: center; background: #e6eddf; color: var(--forest); font: 600 1.4rem "Fraunces", serif; }
.card strong, .card span { display: block; }

/* Formulare */
.form { display: grid; gap: 16px; }
.form.narrow { max-width: 460px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-weight: 600; font-size: .93rem; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; font: 400 1rem "Source Sans 3", sans-serif; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(47,93,58,.14); }
input[type=file] { font: inherit; font-weight: 400; padding: 8px; border: 1.5px dashed var(--line); border-radius: 9px; background: #fcfbf7; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check.inline { display: inline-flex; margin-left: 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--forest); }
.checks { display: flex; flex-wrap: wrap; gap: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.danger-zone { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.current-img { display: flex; align-items: center; gap: 16px; }
.current-img img { width: 140px; border-radius: 8px; }
.current-img.wide img { width: 280px; }
.dropzone { border: 2px dashed #cfd9c6; background: #f7faf4; border-radius: var(--radius); padding: 18px; }
.dropzone input { border: 0; background: none; padding: 6px 0 0; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.img-item { background: #faf8f3; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.img-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.img-item input { padding: 6px 8px; font-size: .9rem; }
.link-danger { background: none; border: 0; color: var(--flame); font: 600 .85rem "Source Sans 3", sans-serif; cursor: pointer; text-align: left; padding: 2px 0; }
.meta-list { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin: 0 0 18px; }
.meta-list dt { color: var(--muted); font-weight: 600; }
.meta-list dd { margin: 0; }
.message-body { background: #faf8f3; border-radius: 10px; padding: 18px; margin-bottom: 18px; white-space: normal; }

/* Login */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: url("../img/landschaft.svg") center bottom / cover no-repeat, var(--paper);
}
.login-card { width: min(400px, 100%); background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px; box-shadow: 0 20px 50px -20px rgba(31,42,34,.35); text-align: center; }
.login-card h1 { margin: 14px 0 0; font-size: 1.7rem; }
.login-card img { margin: 0 auto; }
.login-card .muted { margin: 2px 0 20px; }
.login-card .stack { display: grid; gap: 14px; text-align: left; }
.login-card .back { display: inline-block; margin-top: 18px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.side-logo { height: 38px; width: auto; max-width: 90px; object-fit: contain; }
.login-logo { height: 64px; width: auto; max-width: 180px; object-fit: contain; }

/* Bilder und Uploader */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--forest); border-color: var(--sun); }
.uploader { margin-top: 12px; }
.drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 30px 20px; border: 2px dashed #c7d4bc; background: #f7faf4; border-radius: var(--radius); cursor: pointer; color: var(--forest); transition: .15s; }
.drop:hover, .drop.over { border-color: var(--forest); background: #eef4e8; }
.drop.busy { opacity: .6; pointer-events: none; }
.drop strong { font-size: 1.05rem; }
.drop .muted { font-weight: 400; font-size: .9rem; max-width: 52ch; }
.up-status { margin-top: 14px; }
.up-bar { height: 8px; background: #ebe6da; border-radius: 99px; overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--forest); transition: width .2s; }
.up-text { margin: 8px 0; }
.up-text .err { color: var(--flame); font-size: .9rem; }
.up-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.up-thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.media-list { display: grid; gap: 10px; margin-bottom: 8px; }
.media-row { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbf7; }
.media-row img { width: 150px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; flex: none; }
.media-row .grow { flex: 1; display: grid; gap: 6px; min-width: 0; }
.row-actions { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; color: var(--ink); }
.icon-btn:hover:not(:disabled) { border-color: var(--forest); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger { color: var(--flame); }
.icon-btn.danger:hover { border-color: var(--flame); }
@media (max-width: 640px) { .media-row { flex-wrap: wrap; } .media-row img { width: 100%; } }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.lib-actions { display: flex; justify-content: space-between; }
.link-btn { background: none; border: 0; color: var(--forest); font: 700 .85rem "Source Sans 3", sans-serif; cursor: pointer; padding: 2px 0; }
.logo-preview { display: flex; gap: 10px; margin-bottom: 12px; }
.logo-preview img { height: 70px; width: auto; max-width: 45%; object-fit: contain; padding: 10px; border-radius: 10px; background: #f6f1e7; border: 1px solid var(--line); }
.logo-preview img.dark { background: var(--forest-dark); }
.hint { background: #fffaf0; border-color: #f0dcb4; }
.media-row .avatar.link-avatar { width: 150px; aspect-ratio: 16/9; height: auto; border-radius: 8px; flex: none; display: grid; place-items: center; background: #e6eddf; color: var(--forest); font: 600 1.6rem "Fraunces", serif; }
.small { font-size: .88rem; }
.flyer-field { display: grid; gap: 10px; }
.current-img img.flyer-prev { width: 110px; aspect-ratio: 3/4; object-fit: cover; border: 1px solid var(--line); }
.pdf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 10px; background: #f8e7df; color: var(--flame); font-weight: 700; text-decoration: none; }
.cover-tag { position: absolute; }

/* ---------- Baukasten Editor ---------- */
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.editor-head h2 { margin: 0; }
.block-editor { margin-bottom: 20px; }
.bk-list { display: grid; gap: 0; }
.bk-empty { text-align: center; padding: 34px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: #fff; margin-bottom: 12px; }
.bk-empty strong { color: var(--ink); font-size: 1.05rem; }
.bk { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(31,42,34,.05); transition: box-shadow .15s, border-color .15s; position: relative; }
.bk:hover { border-color: #cfd8c4; }
.bk.open { box-shadow: 0 10px 30px -18px rgba(31,42,34,.35); border-color: #c3d0b6; }
.bk.bk-bg-hell { border-left: 4px solid #e6ddc8; }
.bk.bk-bg-dunkel { border-left: 4px solid var(--forest); }
.bk.dragging { opacity: .45; }
.bk.drop-before::before, .bk.drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; background: var(--sun); border-radius: 4px; }
.bk.drop-before::before { top: -10px; }
.bk.drop-after::after { bottom: -10px; }
.bk.flash-new { animation: bkflash 1.2s ease; }
@keyframes bkflash { 0% { box-shadow: 0 0 0 4px rgba(233,162,59,.7); } 100% { box-shadow: 0 0 0 0 rgba(233,162,59,0); } }
.bk-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; user-select: none; }
.bk-handle { cursor: grab; color: #a9ae9f; font-size: 1.25rem; line-height: 1; padding: 4px 2px; }
.bk-handle:active { cursor: grabbing; }
.bk-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: #eef3e9; color: var(--forest); flex: none; }
.bk-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bk-titles strong { font-size: .98rem; }
.bk-sum { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.bk-tool { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; font-size: .95rem; color: var(--ink); }
.bk-tool:hover:not(:disabled) { background: #f3f0e8; border-color: var(--line); }
.bk-tool:disabled { opacity: .25; cursor: default; }
.bk-tool.danger:hover { background: #fbe6de; border-color: #efc4b4; }
.bk-chev { width: 24px; text-align: center; color: var(--muted); transition: transform .15s; }
.bk.open .bk-chev { transform: rotate(180deg); }
.bk-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.bk.open .bk-body { display: block; }
.bk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding-top: 14px; }
.bk-f { display: grid; gap: 6px; align-content: start; min-width: 0; }
.bk-f.wide { grid-column: 1 / -1; }
.bk-l { font-weight: 700; font-size: .9rem; }
.bk-f input[type=text], .bk-f input[type=number], .bk-f select, .bk-f textarea { width: 100%; }
.bk-check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; padding-top: 22px; }
.bk-check input { width: 18px; height: 18px; accent-color: var(--forest); }
.bk-hint { color: var(--muted); font-size: .84rem; }
.bk-tb { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-btn { font: 600 .88rem "Source Sans 3", sans-serif; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.bk-btn:hover { border-color: var(--forest); color: var(--forest); }
.bk-btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.bk-btn.primary:hover { background: var(--forest-dark); color: #fff; }
.bk-btn.danger { color: var(--flame); }
.bk-btn.danger:hover { border-color: var(--flame); }
.bk-btn.tb-b { font-weight: 800; min-width: 36px; }
.bk-btn.add { justify-self: start; border-style: dashed; color: var(--forest); padding: 9px 14px; }
.bk-opts { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .9rem; color: var(--muted); }
.bk-opts label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.bk-opts select { width: auto; padding: 6px 10px; }

.bk-drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 16px; border: 2px dashed #c7d4bc; background: #f7faf4; border-radius: 12px; color: var(--forest); transition: .15s; }
.bk-drop.small { padding: 16px; }
.bk-drop.over, .bk-gal.over { border-color: var(--sun); background: #fff7e8; }
.bk-drop .muted { font-size: .86rem; }
.bk-drop-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.bk-single { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bk-single.busy { opacity: .5; pointer-events: none; }
.bk-single > .bk-drop { flex: 1; }
.bk-prev img { width: 160px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.bk-single-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-pdf { width: 160px; height: 110px; border-radius: 8px; display: grid; place-items: center; background: #f8e7df; color: var(--flame); font-weight: 700; }
.bk-prog { font-size: .92rem; padding: 10px 12px; border-radius: 10px; background: #f3f0e8; }
.bk-prog.ok { background: #e3eedb; color: #234a2c; font-weight: 600; }
.bk-prog.err { background: #f8e1d8; color: #7a2a12; }
.bk-bar { height: 6px; background: #e3ddd0; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bk-bar i { display: block; height: 100%; background: var(--forest); transition: width .2s; }
.bk-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; border: 2px dashed transparent; border-radius: 12px; }
.bk-gi { position: relative; background: #faf8f3; border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 6px; cursor: grab; }
.bk-gi.dragging { opacity: .4; }
.bk-gi-img { position: relative; }
.bk-gi-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; pointer-events: none; }
.bk-gi-n { position: absolute; left: 6px; top: 6px; background: rgba(31,42,34,.7); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.bk-gi input { padding: 5px 8px; font-size: .85rem; }
.bk-x { position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--flame); cursor: pointer; font-size: .8rem; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.bk-x:hover { background: var(--flame); color: #fff; }
.bk-items { display: grid; gap: 10px; }
.bk-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; background: #fcfbf7; }
.bk-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bk-item-head strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-item .bk-fields { padding-top: 8px; }
.bk-item .bk-prev img, .bk-item .bk-pdf { width: 120px; height: 80px; }

.bk-insert { height: 14px; display: flex; align-items: center; justify-content: center; position: relative; }
.bk-insert button { opacity: 0; position: relative; z-index: 2; font: 700 .78rem "Source Sans 3", sans-serif; color: var(--forest); background: #fff; border: 1.5px dashed #b9c8ac; border-radius: 99px; padding: 2px 12px; cursor: pointer; transition: opacity .15s; }
.bk-insert:hover button, .bk-insert button:focus { opacity: 1; }
.bk-add-main { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 2px dashed #b9c8ac; border-radius: var(--radius); background: #f7faf4; color: var(--forest); font: 700 1.05rem "Source Sans 3", sans-serif; cursor: pointer; }
.bk-add-main:hover { background: #eef4e8; border-color: var(--forest); }
.bk-status { position: sticky; top: 8px; z-index: 5; margin-bottom: 10px; background: #fff7e8; border: 1px solid #f0dcb4; color: #7a5410; font-weight: 700; padding: 10px 14px; border-radius: 10px; }

.bk-modal { position: fixed; inset: 0; z-index: 100; background: rgba(20,30,22,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bk-panel { background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
.bk-panel.wide { width: min(1000px, 100%); }
.bk-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.bk-panel-head h3 { margin: 0; font: 600 1.25rem "Fraunces", serif; }
.bk-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f3f0e8; cursor: pointer; font-size: 1rem; }
.bk-panel-body { padding: 6px 20px 20px; overflow-y: auto; }
.bk-panel-body h4 { margin: 16px 0 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bk-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.bk-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.bk-type { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.bk-type:hover { border-color: var(--forest); background: #f7faf4; }
.bk-type strong { display: block; font-size: .96rem; }
.bk-type small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; margin-top: 2px; }
.bk-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding-top: 14px; }
.bk-mt { padding: 0; border: 3px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #eee; position: relative; }
.bk-mt img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.bk-mt:hover { border-color: #c7d4bc; }
.bk-mt.on { border-color: var(--forest); }
.bk-mt.on::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-weight: 700; }

.page-settings summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.page-settings[open] summary { margin-bottom: 12px; }
.save-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin: 0 -16px; background: rgba(244,241,234,.95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.save-bar .muted { font-size: .9rem; }
.filter-tabs { margin-bottom: 14px; }

@media (max-width: 700px) {
  .bk-fields { grid-template-columns: 1fr; }
  .bk-head { flex-wrap: wrap; }
  .bk-titles { flex-basis: calc(100% - 100px); }
  .bk-tools { width: 100%; justify-content: flex-end; }
  .bk-check { padding-top: 0; }
  .bk-insert button { opacity: 1; }
}

/* Felder dürfen auf schmalen Bildschirmen nie über den Rand ragen */
label, .bk-f, .bk-fields > *, .form .row > * { min-width: 0; }
input, select, textarea { max-width: 100%; min-width: 0; }
.inner, .block-editor, .bk, .bk-body { min-width: 0; }
@media (max-width: 860px) { .save-bar { margin: 0 -16px; } }
