:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --ink: #1d231f;
  --muted: #6b726c;
  --line: #e2e0d9;
  --accent: #2f6b40;
  --accent-ink: #ffffff;
  --accent-soft: #e6efe7;
  --warn: #9a5b00;
  --warn-soft: #fdf3e1;
  --bad: #a3322a;
  --bad-soft: #fbe9e7;
  --info: #2b5d8c;
  --info-soft: #e7eff8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 20, .06), 0 4px 16px rgba(20, 30, 20, .04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
code { background: #efeee9; padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* Kopfzeile */
.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; }
.brand.big { font-size: 20px; margin-bottom: 18px; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 550; }
.top nav a:hover { background: var(--bg); color: var(--ink); }
.top nav a.on { background: var(--accent-soft); color: var(--accent); }
.who { color: var(--muted); font-size: 14px; white-space: nowrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; }
.back { display: inline-block; margin-bottom: 6px; text-decoration: none; font-size: 14px; }
section { margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }

/* Buttons & Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.light { background: var(--card); color: var(--accent); border-color: var(--line); }
.btn.light:hover { background: var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover { background: var(--bg); color: var(--ink); }
.btn.danger { background: var(--card); color: var(--bad); border-color: #ecc9c4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.wide { width: 100%; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; white-space: nowrap; }
label.inline input { margin: 0; width: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form h2 { margin-top: 8px; }
.form h2:not(:first-child) { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.formactions { display: flex; gap: 10px; margin-top: 8px; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }
.counter { float: right; font-weight: 500; font-size: 12px; color: var(--muted); }
.counter.over { color: var(--bad); font-weight: 700; }
.stack { display: grid; gap: 10px; }
.stack label { margin-bottom: 0; }
form.inline { display: inline; }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--accent-soft); color: #1f4a2b; border: 1px solid #cfe0d2; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #f1dcb4; }

/* Bot-Leiste */
.botbar { display: none; background: var(--info-soft); border-bottom: 1px solid #cddcee; color: var(--info); }
.botbar.show { display: block; }
.botbar.wait { background: #fff4d6; border-color: #f0d68a; color: #7a5300; }
.botbar .inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 10px; font-weight: 550; }
.botbar .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; flex: none; }
.botbar form { margin: 0; }
@keyframes pulse { 50% { opacity: .3; } }
.spacer { flex: 1; }

/* Übersicht */
.newform { display: flex; gap: 8px; }
.newform input { width: 280px; }
.upcoming .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; text-decoration: none; color: var(--ink); font-size: 14px; }
.chip:hover { border-color: var(--accent); }
.upcoming h2 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 9px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.tabs .count { background: #e9e8e2; color: var(--muted); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.tabs .search { margin-left: auto; padding-bottom: 6px; }
.tabs .search input { width: 220px; padding: 7px 10px; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.row:first-child { border-top: 0; }
.row.header { background: #faf9f6; font-weight: 500; color: var(--muted); font-size: 14px; padding: 9px 16px; margin: 0; }
.row.link:hover { background: #faf9f6; }
.row input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 650; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title:hover { color: var(--accent); }
.row .sub { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .sub .price { color: var(--ink); font-weight: 650; }
.row .sub .when { color: var(--info); font-weight: 600; }
.row form { margin: 0; }
.problems { color: var(--warn); font-size: 13px; margin-top: 3px; }
.thumb { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: #ecebe5; flex: none; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.noimg { font-size: 11px; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: #ecebe5; color: var(--muted); }
.badge.freigegeben { background: var(--accent-soft); color: var(--accent); }
.badge.geplant, .badge.laeuft, .badge.job-geplant, .badge.job-laeuft { background: var(--info-soft); color: var(--info); }
.badge.online, .badge.job-erfolgreich { background: #2f6b40; color: #fff; }
.badge.geaendert { background: var(--warn-soft); color: var(--warn); }
.badge.fehler, .badge.job-fehler { background: var(--bad-soft); color: var(--bad); }

.actionbar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 20px rgba(20,30,20,.08); }
.empty { text-align: center; padding: 40px; }

/* Bearbeiten */
.editgrid, .previewgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.shipbox { background: #faf9f6; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: -4px 0 14px; }
.shipbox p { margin: 0 0 8px; font-size: 13px; }
.optgroup { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin-bottom: 6px; }
.optgroup b { width: 18px; }
.optgroup label.check, .shipbox > label.check { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gimg { position: relative; border-radius: 8px; overflow: hidden; background: #ecebe5; aspect-ratio: 4 / 3; }
.gimg.first { outline: 2px solid var(--accent); outline-offset: -2px; }
.gimg.first::after { content: "Titelbild"; position: absolute; top: 4px; left: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.gimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gimg form { position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; gap: 2px; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .15s; }
.gimg:hover form { opacity: 1; }
.gimg button { background: rgba(255,255,255,.92); border: 0; border-radius: 5px; width: 26px; height: 24px; cursor: pointer; font-size: 12px; }
.gimg button:disabled { opacity: .35; cursor: default; }
.gimg button.del { color: var(--bad); }
.drop { display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop b { color: var(--accent); }
.warnbox { border-color: #f1dcb4; background: #fffbf3; }
.warnbox h2 { color: var(--warn); }
.warnbox ul { margin: 0; padding-left: 18px; }

/* Vorschau im Stil einer Kleinanzeige */
.ka { padding: 0; overflow: hidden; }
.ka-main { background: #1d1d1b; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.ka-main img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ka-main.empty { color: #aaa; background: #ecebe5; }
.ka-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #f7f6f2; border-bottom: 1px solid var(--line); }
.ka-thumbs img { width: 76px; height: 57px; object-fit: cover; border-radius: 5px; cursor: pointer; opacity: .65; border: 2px solid transparent; }
.ka-thumbs img.on { opacity: 1; border-color: var(--accent); }
.ka-body { padding: 20px 24px 24px; }
.ka-title { font-size: 22px; margin-bottom: 6px; }
.ka-price { font-size: 24px; font-weight: 750; color: var(--accent); margin-bottom: 8px; }
.ka-meta { display: flex; gap: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.ka-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0; padding: 10px 0; display: grid; gap: 6px; }
.ka-details div { display: flex; gap: 12px; font-size: 14px; }
.ka-details span { color: var(--muted); width: 90px; flex: none; }
.ka-desc { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.55; }

/* Aufträge */
.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.actions3 p { margin: 8px 0 0; }
.row-actions { display: flex; gap: 8px; }
.row-actions form { margin: 0; }
.log { background: #171a18; color: #d9e2da; padding: 14px; border-radius: 9px; max-height: 560px; overflow: auto; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin: 0; }
ul.plain { margin: 0; padding-left: 18px; }
.creds { display: flex; gap: 24px; margin: 14px 0; flex-wrap: wrap; }
.creds span { display: block; color: var(--muted); font-size: 13px; }
.steps li { margin-bottom: 4px; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login { width: 360px; max-width: calc(100% - 32px); }

@media (max-width: 900px) {
  .editgrid, .previewgrid { grid-template-columns: 1fr; }
  .actions3 { grid-template-columns: 1fr; }
  .top { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 16px; }
  .top nav { grid-column: 1 / -1; overflow-x: auto; }
  .top nav a { padding: 6px 10px; }
  .brand span:last-child { font-size: 14px; }
  .actionbar { position: static; }
  .actionbar label.inline { flex-wrap: wrap; white-space: normal; }
  input { min-width: 0; }
  .wrap { padding: 16px; }
  .newform { width: 100%; }
  .head > div { min-width: 0; }
  .newform input { width: auto; flex: 1; }
  .two { grid-template-columns: 1fr; }
  .tabs .search { margin-left: 0; width: 100%; }
  .tabs .search input { width: 100%; }
  .row { flex-wrap: wrap; }
  .row .main { flex-basis: calc(100% - 130px); }
  .row > .btn { display: none; }
}

/* Vorlagen */
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.suggest .chip { font: inherit; cursor: pointer; }
.suggest .chip:hover { border-color: var(--accent); color: var(--accent); }
.shipbox p { margin: 2px 0; }
.inline-select { width: auto; padding: 8px 10px; }
.warnlist { margin: 4px 0 0; padding-left: 18px; color: var(--ink); }
.warnlist li { margin-bottom: 4px; }
.doclist { list-style: none; padding: 0; margin: 0 0 12px; }
.doclist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.doclist li:first-child { border-top: 0; }
.doclist form { margin: 0 0 0 auto; }

/* Live Browser */
.live .screenwrap { background: #1b1d1c; border-radius: 10px; overflow: hidden; margin: 10px 0; }
.live #screen { display: block; width: 100%; height: auto; cursor: crosshair; }
.urlline { word-break: break-all; margin-bottom: 10px; }
.typeform { display: flex; gap: 8px; margin-bottom: 10px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
