:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1c2333;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
  --line: #e2e8f0;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
}
* { box-sizing: border-box; }
.hidden { display: none !important; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
button.small { padding: 5px 12px; font-size: 12.5px; }
#manual-form label { display: block; font-size: 12.5px; color: var(--muted); margin: 8px 0 3px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
html, body { overflow-x: hidden; }   /* kein horizontaler Scroll auf mobile */
img { max-width: 100%; height: auto; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ctitle, .li-title, .li-sum, .csnip, .chat-answer, .wi-c { overflow-wrap: anywhere; }
.card .csrc, .li-src { word-break: break-all; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.mobile-header { display: none; }
.mobile-project-name {
  font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer; min-width: 0;
}
.mobile-project-name:hover { color: var(--accent); }
.mobile-project-btn {
  flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; font-size: 18px; line-height: 1;
  cursor: pointer;
}
.logo { font-size: 26px; }
h1 { font-size: 20px; margin: 0; }
#app-title { cursor: pointer; }
#app-title:hover { color: var(--accent); }
h1 .year { color: var(--accent); }
.status { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--line); color: var(--muted);
}
.pill.ok { background: #dcfce7; color: var(--ok); }
.pill.bad { background: #fee2e2; color: var(--danger); }
.pill.warn { background: #fef3c7; color: var(--warn); }
main {
  max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px;
  display: grid; gap: 16px;
}
.view-tabs {
  display: flex; gap: 8px; border-bottom: 2px solid var(--line);
  padding-bottom: 10px; flex-wrap: wrap;
}
.vt {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  padding: 8px 18px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.vt.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.view { display: none; }
.view.active { display: grid; gap: 16px; }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
h2 { font-size: 15px; margin: 0 0 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
  border: 1px solid var(--line); background: var(--panel); padding: 6px 14px;
  border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabform { display: none; gap: 8px; flex-wrap: wrap; }
.tabform.active { display: flex; }
textarea, input[type="text"], input[type="url"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; }
.tabform textarea, .tabform input { flex: 1 1 100%; }
.ingest-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ingest-row input[type="file"] { flex: 1; min-width: 200px; padding: 6px; }
.websearch-details { margin-top: 14px; }
.websearch-details summary { cursor: pointer; font-size: 13px; color: var(--accent-dark); margin-bottom: 8px; }
button {
  background: var(--accent); color: #fff; border: 0; padding: 9px 18px;
  border-radius: 8px; font-size: 14px; cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button.danger { background: var(--danger); }
.msg { margin-top: 10px; font-size: 13px; display: none; }
.msg.ok { display: block; color: var(--ok); }
.msg.err { display: block; color: var(--danger); }

.chat-result { margin-top: 12px; font-size: 14px; }
.chat-artifacts { margin-top: 12px; }
#chat-form button { margin-top: 10px; }
.rag-settings { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.rag-settings > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); list-style: none; }
.rag-settings > summary::-webkit-details-marker { display: none; }
.rag-settings > summary::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .15s; }
.rag-settings[open] > summary::before { transform: rotate(90deg); }
.rag-settings-body { padding: 10px 12px 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.rag-field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.rag-field input[type="number"] { max-width: 120px; }
.rag-field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; resize: vertical; }
.rag-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rag-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rag-actions .msg { margin: 0; }
.search-details { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.search-details > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); list-style: none; }
.search-details > summary::-webkit-details-marker { display: none; }
.search-details > summary::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .15s; }
.search-details[open] > summary::before { transform: rotate(90deg); }
.search-details-body { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.search-details-body h4 { margin: 10px 0 6px; font-size: 12.5px; color: var(--muted); }
.search-chunk { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 8px 10px; margin-bottom: 8px; }
.search-chunk-head { font-size: 12.5px; margin-bottom: 4px; overflow-wrap: anywhere; }
.search-chunk-idx { color: var(--accent-dark); font-weight: 700; }
.search-chunk-text { margin: 0; max-height: 220px; overflow: auto; font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 6px; padding: 6px 8px; }
.search-web-q { margin-bottom: 8px; }
.chat-answer {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px;
  padding: 12px 14px; line-height: 1.55; overflow-wrap: anywhere;
}
.chat-answer :first-child { margin-top: 0; }
.chat-answer :last-child { margin-bottom: 0; }
.chat-answer h1, .chat-answer h2, .chat-answer h3, .chat-answer h4 { margin: .6em 0 .25em; font-size: 1.06em; }
.chat-answer ul, .chat-answer ol { margin: .4em 0; padding-left: 22px; }
.chat-answer li { margin: .15em 0; }
.chat-answer code { background: #e2e8f0; border-radius: 4px; padding: 1px 4px; font-size: .92em; }
.chat-answer pre { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: .5em 0; white-space: pre; }
.chat-answer pre code { background: transparent; color: inherit; padding: 0; }
.chat-answer a { color: var(--accent-dark); }
.chat-answer { white-space: normal; }
.sources { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.source-chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--accent-dark);
}

/* Markdown-Antwortbox (Chat + Karte) */
.answer-box {
  position: relative; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.answer-box .chat-answer { background: transparent; border: 0; border-radius: 0; padding: 0; }
.answer-tools { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 6px; }
.answer-preview {
  font-size: 12.5px; line-height: 1.45; color: var(--ink);
  overflow-wrap: anywhere; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.icon-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 3px 8px; font-size: 13px; line-height: 1.2; cursor: pointer;
  color: var(--accent-dark);
}
.icon-btn:hover { border-color: var(--accent); background: #e0f2fe; }
.answer-overlay {
  position: fixed; inset: 0; z-index: 2100; padding: 18px;
  background: rgba(15, 23, 42, .62);
  display: flex; align-items: center; justify-content: center;
}
.answer-overlay.hidden { display: none; }
.answer-overlay-box {
  background: #fff; border-radius: 14px; width: min(1100px, 96vw);
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.answer-overlay-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.answer-overlay-title { font-weight: 700; overflow-wrap: anywhere; }
.answer-overlay-actions { display: flex; gap: 6px; flex: 0 0 auto; }
#answer-overlay-body {
  padding: 14px 18px 22px; overflow-y: auto;
  background: transparent; border: 0; border-radius: 0;
}

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.empty { color: var(--muted); font-size: 14px; }
.month-group { margin-bottom: 18px; }
.month-label {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px;
  position: relative;
}
.month-label::before {
  content: ""; position: absolute; left: -19px; top: 6px; width: 9px; height: 9px;
  background: var(--accent); border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 36px 10px 12px; margin-bottom: 8px; cursor: pointer;
  transition: box-shadow .12s, border-color .12s; position: relative;
}
.card-del { position: absolute; top: 8px; right: 8px; z-index: 1; }
.card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: var(--accent); }
.card .date { font-size: 12px; color: var(--accent-dark); font-weight: 600; }
.card .cpreis { font-size: 12px; font-weight: 700; color: var(--ok); margin: 2px 0; }
.card .ctitle { font-size: 14px; font-weight: 600; margin: 2px 0; }
.card .csnip { font-size: 13px; color: var(--muted); }
.card .csrc { font-size: 11px; color: var(--muted); margin-top: 4px; }

.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 20px; }
#place-modal { z-index: 90; }
#wz-discard-modal { z-index: 120; }
#new-place-modal { z-index: 130; }
#new-place-form label { display: block; font-size: 12.5px; color: var(--muted); margin: 8px 0 3px; }
#new-place-form select, #manual-form select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.modal.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 14px; max-width: 720px; width: 100%;
  max-height: 86vh; overflow-y: auto; padding: 22px; position: relative;
}
.modal-close { position: absolute; top: 12px; right: 12px; background: var(--line);
  color: var(--ink); padding: 4px 10px; border-radius: 8px; }
.m-meta { font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.m-summary { font-size: 14px; }
.m-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.m-tags span { background: #f1f5f9; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.m-list { margin: 4px 0 12px; padding-left: 18px; font-size: 13px; }
.m-list li { margin: 3px 0; }
.m-list .muted { color: var(--muted); }
.m-raw {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 12.5px; white-space: pre-wrap; max-height: 240px;
  overflow-y: auto;
}
.m-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
#m-close { background: #2563eb; }
#m-close:hover { background: #1d4ed8; }
#new-place-modal .m-actions { gap: 10px; }
#wz-discard-modal .m-actions { gap: 10px; }
.web-results { margin-top: 12px; }
.web-warn {
  font-size: 12px; color: var(--warn); background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 6px 9px;
  margin-bottom: 8px; overflow-wrap: anywhere;
}
.web-item {
  display: block; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 6px; font-size: 13px;
}
.wi-head { display: flex; gap: 8px; align-items: flex-start; }
.wi-pick { flex: 0 0 auto; margin-top: 3px; }
.wi-title { font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.wi-title:hover { text-decoration: underline; }
.wi-url { color: var(--accent-dark); font-size: 11px; word-break: break-all; text-decoration: none; display: block; margin-top: 2px; }
.wi-url:hover { text-decoration: underline; }
.wi-c { color: var(--muted); font-size: 12px; }
.web-ingest { margin-top: 10px; }
.web-ingest:disabled { opacity: .55; cursor: not-allowed; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.liste-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.li-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.li-time { color: var(--accent-dark); font-weight: 700; white-space: nowrap; font-size: 12px; }
.li-color { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  display: inline-block; vertical-align: middle;
  align-self: center; border: 1px solid rgba(0,0,0,.18); box-shadow: 0 0 0 1px #fff; }
.li-title { font-weight: 700; }
.li-labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.li-report { margin: 6px 0 4px; }
.li-report > summary { cursor: pointer; font-size: 12.5px; color: var(--accent-dark); }
.li-report-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-report-toggle { flex: 0 0 auto; }
.li-report-actions { margin-left: auto; display: inline-flex; align-items: center;
  gap: 6px; flex-wrap: wrap; }
.li-report-sep { color: var(--muted); }
.li-report-copy { margin-left: 4px; padding: 0; font-size: 12.5px;
  color: var(--accent-dark); background: transparent; border: 0;
  text-decoration: underline; }
.li-report-copy:hover { color: var(--accent); background: transparent; }
.li-report-copybar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.li-report-body { margin-top: 6px; padding: 10px 12px; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.55; }
.li-report-body h2, .li-report-body h3, .li-report-body h4 { margin: .7em 0 .3em; font-size: 1.05em; }
.li-report-body h2:first-child, .li-report-body h3:first-child, .li-report-body h4:first-child { margin-top: 0; }
.li-report-body p { margin: .45em 0; }
.li-report-body > :first-child { margin-top: 0; }
.li-report-body > :last-child { margin-bottom: 0; }
.li-report-body ul, .li-report-body ol { margin: .4em 0; padding-left: 22px; }
.li-report-body li { margin: .15em 0; }
.md-table-wrap { overflow-x: auto; margin: 8px 0; }
.md-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
.md-table th { background: #e2e8f0; font-weight: 700; }
.li-report-body, .chat-answer { overflow-x: auto; }
.li-report-body table, .chat-answer table { width: 100%; border-collapse: collapse;
  margin: 8px 0; font-size: 12.5px; }
.li-report-body th, .li-report-body td,
.chat-answer th, .chat-answer td { border: 1px solid var(--line);
  padding: 5px 7px; text-align: left; vertical-align: top; }
.li-report-body th, .chat-answer th { background: #e2e8f0; font-weight: 700; }
.li-events { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.li-del { background: transparent; border: 0; padding: 0 2px; margin-left: 2px;
  font-size: 14px; line-height: 1; cursor: pointer; color: var(--muted); }
.li-del:hover { color: #b91c1c; }
.li-sum { color: var(--muted); margin-top: 4px; }
.li-src { font-size: 11px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.li-src a { color: var(--accent-dark); }
.li-orig { font-size: 12px; color: var(--accent-dark); margin-top: 4px; font-weight: 600; }
.liste-item { cursor: default; }
.orig-img { max-width: 100%; border-radius: 10px; margin: 10px 0; border: 1px solid var(--line); }
.orig-link { font-size: 13px; margin: 8px 0; }
.orig-link a { color: var(--accent-dark); word-break: break-all; }
.orig-sources { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.orig-source { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.os-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.os-kind { font-size: 12px; color: var(--muted); }
.os-title { word-break: break-word; }
.os-dl { margin-left: auto; text-decoration: none; font-size: 14px; }
.os-media { font-size: 13px; margin-top: 4px; }
.os-media a { color: var(--accent-dark); word-break: break-all; }
.os-meta { font-size: 12px; margin-top: 4px; }
.os-text { margin-top: 6px; font-size: 12.5px; }
.os-text summary { cursor: pointer; color: var(--accent-dark); }
.orig-add { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.orig-add summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); }
.orig-add form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.orig-add textarea { width: 100%; box-sizing: border-box; }
.orig-add input[type=file] { font-size: 12.5px; }
.orig-add button { align-self: flex-start; }

/* Bild-Betrachter */
#img-viewer {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 18px;
  background: rgba(4, 12, 20, .94);
}
#img-viewer.hidden { display: none; }
.iv-stage {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; max-width: calc(100vw - 130px); max-height: 100%;
}
#iv-img {
  max-width: 100%; max-height: calc(100vh - 120px);
  object-fit: contain; border-radius: 8px;
  background: #000; box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.iv-foot { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #e6eef5; text-align: center; }
#iv-caption { font-size: 13px; max-width: 80vw; overflow-wrap: anywhere; }
#iv-counter { font-size: 12px; color: #9fb3c4; }
.iv-nav {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08);
  color: #fff; font-size: 34px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.iv-nav:hover { background: rgba(255,255,255,.2); }
.iv-nav:disabled { opacity: .25; cursor: default; }
.iv-close {
  position: fixed; top: 12px; right: 14px; z-index: 2001;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08);
  color: #fff; font-size: 18px; cursor: pointer;
}
.iv-close:hover { background: rgba(255,255,255,.2); }
button.os-image-open {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in; text-align: left;
}
button.os-image-open .orig-img { margin: 4px 0 0; }
.m-image-open { cursor: zoom-in; }
@media (max-width: 600px) {
  .iv-nav { width: 42px; height: 42px; font-size: 28px; }
  .iv-stage { max-width: calc(100vw - 100px); }
}
.cactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cactions button { font-size: 11.5px; padding: 3px 8px; }
.cactions a { font-size: 11.5px; font-weight: 600; color: var(--accent-dark);
  text-decoration: none; padding: 3px 2px; }
.cactions a:hover { text-decoration: underline; }
.date-box .m-actions { gap: 10px; }
.cform { margin-top: 4px; }
.cform-inner { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; }
.cform-inner input[type=date], .cform-inner select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; background: var(--panel); }
.cform-inner .cf-date-pick { max-width: 100%; }
.csubtree { margin-left: 16px; border-left: 2px dashed var(--line); padding-left: 10px; margin-top: 4px; }
.clink { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ca-kids { font-weight: 600; }
#m-orig-slot { margin-bottom: 4px; }
.m-download { display: inline-block; margin: 4px 0 2px; font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.m-download:hover { text-decoration: underline; }
.m-origimg img { display: block; max-width: 240px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0; object-fit: cover; }
.m-origimg:hover img { border-color: var(--accent); }
.reset-img { display: block; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 10px 0; }
#reset-captcha { width: 100%; padding: 9px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
#reset-modal .m-actions { margin-top: 10px; }
#login-form { display: flex; gap: 8px; margin-top: 10px; }
#login-form input { flex: 1; padding: 9px 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
#login-modal .modal-box { max-width: 360px; }

/* Projektauswahl */
.project-box { max-width: 620px; }
.project-info-box { max-width: 560px; }
#project-archives-wrap > summary { cursor: pointer; font-weight: 700; margin: 10px 0 6px; }
#project-info-stats { margin: 4px 0 16px; }
.project-info-box label { display: block; font-size: 12.5px; color: var(--muted); margin: 8px 0 3px; }
.project-info-box .m-actions { gap: 10px; }
.project-list { display: grid; gap: 8px; margin: 10px 0; }
.project-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.project-main { min-width: 0; }
.project-main b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.project-slug { font-size: 12px; color: var(--muted); }
.project-actions { display: flex; gap: 6px; flex-shrink: 0; }
.project-create { display: flex; gap: 8px; margin-top: 12px; }
.project-create input { flex: 1; }
#project-archives-wrap h3 { font-size: 13px; margin: 16px 0 0; }
#project-archive-list .project-row { padding: 8px 10px; }

/* Backups */
.backups-box { max-width: 860px; }
.backup-status { margin: 4px 0 10px; line-height: 1.5; }
.backup-actions { justify-content: flex-start; gap: 10px; margin: 0 0 8px; }
.backup-list { max-height: 55vh; overflow-y: auto; margin-top: 8px; }
.backup-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; }
.backup-main { min-width: 0; }
.backup-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.backup-fp { font-size: 11px; margin-top: 2px; overflow-wrap: anywhere; }
.backup-row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.backup-download { display: inline-block; padding: 5px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--accent); color: #fff; text-decoration: none; white-space: nowrap; }
.backup-download:hover { background: var(--accent-dark); }
@media (max-width: 640px) {
  #btn-backups { display: none !important; }
  .backup-row { flex-direction: column; }
  .backup-row-actions { justify-content: flex-start; }
}

/* Performance-Reports */
.perf-box { max-width: 900px; }
.perf-box .m-actions { gap: 10px; }
.perf-list { max-height: 58vh; overflow-y: auto; }
.perf-report { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.perf-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.perf-label { font-weight: 600; }
.perf-detail { color: var(--muted); font-size: 12px; }
.perf-total { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent-dark); font-weight: 600; }
.perf-bad { color: var(--danger); }
.perf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.perf-table th, .perf-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.perf-table th { color: var(--muted); font-weight: 500; }
.perf-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.perf-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.perf-cat { color: var(--muted); font-size: 11px; }
.perf-empty { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* Orte-Verzeichnis */
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Label-Filter (Zeitlinie, Orte, Quellen) */
.label-filter { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.label-filter > summary { cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.label-filter[open] > summary { border-bottom: 1px solid var(--line); }
.lf-body { padding: 10px 12px; }
.lf-actions { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.lf-search-wrap { position: relative; margin: 2px 0 8px; }
.lf-search {
  width: 100%; box-sizing: border-box; padding: 5px 28px 5px 7px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px;
  background: var(--panel);
}
.lf-search-clear {
  display: none; position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0;
  background: transparent; color: var(--muted); font-size: 12px; line-height: 20px;
  text-align: center; cursor: pointer;
}
.lf-search-clear:hover { background: var(--line); color: var(--ink); }
.lf-search:not(:placeholder-shown) + .lf-search-clear { display: inline-block; }
.lf-search-empty { font-size: 12px; margin: 2px 0 6px; }
.lf-labels { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; }
.lf-groups { display: flex; flex-direction: column; gap: 12px; }
.lf-group-head { margin-bottom: 4px; }
.lf-cat-pill {
  display: inline-block; border: 1px solid transparent; border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 700;
}
button.lf-cat-pill { cursor: pointer; font-family: inherit; }
button.lf-cat-pill:hover { filter: brightness(.96); }
button.lf-cat-pill:disabled { cursor: default; opacity: .6; }
.lf-cat-pill.on { box-shadow: inset 0 0 0 1px currentColor; }
.lf-cat-pill.partial { border-style: dashed; }
.lf-chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--lf-border, var(--line));
  border-radius: 999px; padding: 3px 9px; font-size: 12px;
  background: var(--lf-bg, var(--panel)); color: var(--lf-fg, inherit);
  cursor: pointer; user-select: none; max-width: 100%;
}
.lf-chip input { margin: 0; }
.lf-chip:not(.on) { opacity: .55; }
.lf-chip.on { border-color: var(--lf-fg, var(--accent)); box-shadow: inset 0 0 0 1px var(--lf-fg, var(--accent)); }
.lf-chip .muted { font-size: 11px; }
.lf-chip[draggable="true"] { cursor: grab; }
.lf-chip.lf-dragging { opacity: .4; cursor: grabbing; }
.lf-group { border-radius: 8px; transition: outline-color .12s, background .12s; }
.lf-group.lf-drop-target {
  outline: 2px dashed var(--accent); outline-offset: 3px;
  background: rgba(59, 130, 246, .06);
}
.label-trash {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 200; display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  border: 2px dashed var(--danger); background: #fff; color: var(--danger);
  font-size: 14px; font-weight: 700; box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.label-trash.drop-hover {
  background: #fee2e2; border-style: solid; transform: translateX(-50%) scale(1.05);
}
.orte-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ausgaben-total-box {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  font-size: 12.5px; line-height: 1.2;
}
.ausgaben-total-box strong { font-size: 20px; color: var(--accent-dark); }
.ausgaben-list { display: flex; flex-direction: column; gap: 8px; }
.ausgabe-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--panel); font-size: 13px;
}
.ausgabe-item[data-id] { cursor: pointer; }
.ausgabe-item[data-id]:hover { border-color: var(--accent); }
.ausgabe-main { display: flex; gap: 10px; align-items: baseline; }
.ausgabe-was { font-weight: 700; overflow-wrap: anywhere; }
.ausgabe-amount { margin-left: auto; font-weight: 700; color: var(--accent-dark); white-space: nowrap; }
.ausgabe-sub { color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.ausgabe-raw { color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow-wrap: anywhere; }
.ort-geo-group { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ort-geo-group > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 8px; list-style: none; }
.ort-geo-group > summary::-webkit-details-marker { display: none; }
.ort-geo-group > summary::before { content: "▸"; flex: 0 0 auto; transition: transform .15s; }
.ort-geo-group[open] > summary::before { transform: rotate(90deg); }
.ort-geo-group[open] > summary { border-bottom: 1px solid var(--line); }
.ort-source-summary { display: flex; flex: 1; align-items: center; gap: 8px; flex-wrap: wrap; }
.ort-source-head { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ort-source-head .li-title { color: var(--ink); }
.ort-source-map { margin-left: auto; flex: 0 0 auto; }
.ort-source-labels { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.ort-source-label {
  border: 1px solid transparent; border-radius: 999px; padding: 1px 9px;
  font-size: 11.5px; font-weight: 600;
}
.ort-item-compact .ort-head { align-items: center; }
.ort-name-text { font-size: 14px; }
.ort-item .ort-delete { margin-left: auto; padding: 0 2px; }
.ort-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.ort-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.ort-edit { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.ort-edit:hover { text-decoration: underline; }
.ort-images { font-size: 12.5px; font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.ort-images:hover { text-decoration: underline; }
.ort-group-body { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.ort-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ort-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.ort-delete { flex: 0 0 auto; padding: 3px 7px; }
.ort-geo { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.ort-locate {
  background: none; border: 0; padding: 0; margin: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.ort-locate:hover { background: transparent; color: var(--accent-dark); text-decoration: underline; }
.ort-name { font-weight: 700; }
.ort-geo .ort-locate { color: var(--muted); }
.ort-geo .ort-locate:hover { background: transparent; color: var(--accent-dark); }
.ort-geo a { color: var(--accent-dark); }
.ort-geo-edit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.ort-geo-edit input {
  flex: 1 1 220px; min-width: 0; padding: 4px 7px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 12.5px; background: var(--panel);
}
.ort-refs { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ort-ref-row { display: flex; flex-direction: column; gap: 3px; }
.ort-ref {
  align-self: flex-start;
  background: #f1f5f9; color: var(--accent-dark); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ort-ref:hover { border-color: var(--accent); background: #e0f2fe; }
.ort-ref-desc { font-size: 12.5px; color: var(--muted); }

/* Ortsdetails-Dialog */
.place-box h2 { margin: 0 36px 0 0; }
.place-box label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 3px; }
.place-box .m-actions { gap: 10px; margin-top: 16px; }
.place-facts {
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 14px; margin: 6px 0 0; font-size: 13px;
}
.place-facts dt { color: var(--muted); font-weight: 500; }
.place-facts dd { margin: 0; overflow-wrap: anywhere; }
.place-section { margin-top: 16px; }
.place-section.place-source-section { margin-top: 32px; }
.place-source-list { display: flex; flex-direction: column; gap: 8px; }
.place-source-row select { width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: #fff; }
.place-section h3 {
  margin: 0 0 7px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.place-osm-link {
  display: inline-block; margin-top: 9px; font-size: 13px;
  color: var(--accent-dark); font-weight: 600;
}
.place-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.place-tag {
  border: 1px solid transparent; border-radius: 999px;
  padding: 3px 11px; font-size: 12px; font-weight: 600;
}
.place-refs { display: flex; flex-direction: column; gap: 8px; }
.place-ref { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.place-ref-title {
  display: block; max-width: 100%; padding: 0; border: 0; background: none;
  color: var(--accent-dark); font-size: 13px; font-weight: 600;
  text-align: left; overflow-wrap: anywhere; cursor: pointer;
}
.place-ref-title:hover { color: var(--accent); text-decoration: underline; }
.place-ref-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.place-geo-edit { margin-top: 16px; }

/* Ortskarte (Overlay) */
#map-overlay { position: fixed; inset: 0; z-index: 80; background: #fff; display: flex; flex-direction: column; }
#map-overlay.hidden { display: none; }
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.map-head h2 { margin: 0; font-size: 15px; }
.map-head .muted { font-size: 12px; margin-top: 2px; }
.map-head-actions { display: flex; align-items: center; gap: 6px; }
.map-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
#map { min-width: 0; min-height: 0; height: 100%; background: #e5e7eb; }
#map-side { overflow-y: auto; padding: 10px 12px; border-left: 1px solid var(--line); background: var(--bg); }
.map-side-filter { margin-bottom: 4px; }
.map-side-filter .label-filter { margin-top: 0; }
#map-side-list { margin-top: 0; }
#map-side-list .ort-item { background: var(--panel); }
.map-place-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.map-label { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 5px; font-size: 11.5px; font-weight: 600; color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.map-label:before { display: none; }
.map-popup { min-width: 180px; }
.map-popup-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.map-pos-actions { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.map-pos-actions .map-set-pos, .map-pos-actions .map-cancel-pos, .map-pos-actions .map-delete-place { font-size: 11.5px; padding: 3px 8px; }
.map-pos-hint { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.map-pos-coords { font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.map-pos-edit .map-set-pos { font-weight: 700; }
.map-ghost-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px dashed #e11d48; background: rgba(225, 29, 72, .15);
  box-sizing: border-box;
}
.map-side-group-label { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.map-thumbs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 7px; }
.map-thumb {
  display: block; width: 60px; height: 60px; padding: 0; border: 0;
  background: none; cursor: zoom-in; line-height: 0; border-radius: 4px;
  overflow: hidden;
}
.map-thumb img {
  display: block; width: 60px; height: 60px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--line);
}
.map-thumb:hover img { border-color: var(--accent); }
.map-popup-refs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 6px; }
.map-popup-refs button { font-size: 11.5px; padding: 2px 7px; }
.map-source-pill {
  border: 1px solid; border-radius: 999px; cursor: pointer; font-weight: 600;
}
.map-source-pill:hover { box-shadow: 0 0 0 2px rgba(14, 116, 144, .16); }
.map-popup-source { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.map-popup-source + .map-popup-source { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.map-popup-source-color { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.18); box-shadow: 0 0 0 1px #fff; }
.map-popup-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.map-label-chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px;
  font-size: 11px; background: #f1f5f9; color: var(--accent-dark); cursor: pointer;
}
.map-label-chip:hover { border-color: var(--accent); background: #e0f2fe; }
.map-label-result { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.map-answer-box .answer-preview { max-height: 3.9em; }
.map-label-result-head { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.map-label-result-query { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.map-chat-answer { font-size: 12.5px; padding: 8px 10px; }
.map-label-result .sources { gap: 4px; margin-top: 6px; }
.map-label-result .source-chip { font-size: 11px; padding: 2px 7px; }
.map-side-marker { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
@media (max-width: 900px) {
  .map-body { grid-template-columns: 1fr; }
  #map-side { display: none; }
}
.foot { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 12px 26px; }
/* Busy-Overlay (Throbber) */
#busy { position: fixed; inset: 0; z-index: 3000; background: rgba(15,23,42,.38);
  display: flex; align-items: center; justify-content: center; }
#busy.hidden { display: none; }
.busy-box { background: #fff; border-radius: 14px; padding: 20px 26px;
  display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.22); }
.spinner { width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
@media (max-width: 640px) {
  header { display: none; }                 /* ganzer Header weg auf mobile */
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
  }
  main { padding: 10px 10px 88px; }
  .view-tabs { gap: 6px; }
  .vt { flex: 1 1 45%; font-size: 12.5px; padding: 8px 6px; text-align: center; }
  .panel { padding: 12px; }
  .modal { padding: 8px; }
  .modal-box { padding: 16px; max-height: 92vh; }
  .cform-inner select,
  .cform-inner input[type=date] { min-width: 0; width: 100%; }
  .cactions button { flex: 1 1 auto; }
}

/* ---------------- Import-Assistent ---------------- */
.wizard { position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 18px; }
.wizard.hidden { display: none; }
.wizard-box { background: #fff; border-radius: 16px; width: min(960px, 100%);
  max-height: 94vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,.25); }
.wizard-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.wizard-head h2 { margin: 0; font-size: 17px; }
.wizard-steps { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px;
  border-bottom: 1px solid var(--line); background: #f8fafc; }
.wz-step { font-size: 12px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); border-radius: 999px; padding: 4px 10px; }
.wz-step.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.wz-step.done { border-color: #86efac; color: var(--ok); background: #f0fdf4; }
.wizard-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.wizard-foot { border-top: 1px solid var(--line); padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.wizard-foot .msg { order: 1; margin: 0 0 8px; flex: 1 1 100%; }
.wizard-actions { order: 2; display: flex; gap: 8px; align-items: center;
  width: 100%; flex-wrap: nowrap; }
.wizard-actions > button { flex: 0 0 132px; width: 132px; text-align: center; }
.wizard-actions #wz-finish { margin-left: auto; }
.wz-section { margin-bottom: 18px; }
.wz-section h3 { font-size: 14px; margin: 0 0 8px; }
.wz-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wz-section-head h3 { margin: 0; }
.wz-label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
.wz-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.wz-row > input, .wz-row > textarea { flex: 1 1 200px; }
.wz-source, .wz-item { border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.wz-source-head, .wz-item-head { display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 6px; }
.wz-source-head b, .wz-item-head b { overflow-wrap: anywhere; }
.wz-source textarea { min-height: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; }
.wz-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); }
.wz-link { color: var(--accent-dark); word-break: break-all; font-size: 12px; }
.wz-labelchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line);
  background: #f8fafc; border-radius: 999px; padding: 3px 9px; font-size: 12px; }
.wz-chip-del { border: 0; background: transparent; color: var(--danger); padding: 0 2px; font-size: 13px; }
.wz-list { display: grid; gap: 8px; }
.wz-term-grid { display: grid; grid-template-columns: 140px 1fr 2fr auto; gap: 8px; align-items: end; }
.wz-price-grid { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; align-items: end; }
.wz-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wz-place-geo { font-size: 12px; overflow-wrap: anywhere; margin-top: 2px; }
.wz-main { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.wz-main input { width: auto; }
.wz-item.removed { opacity: .55; background: #f8fafc; }
button.wz-restore { background: var(--ok); }
button.wz-restore:hover { background: #15803d; }
.wz-empty { color: var(--muted); font-size: 13px; padding: 10px; }
.wz-danger { color: var(--danger); }
.wz-summary { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 700px) {
  .wizard { padding: 0; }
  .wizard-box { max-height: 100vh; height: 100vh; border-radius: 0; }
  .wizard-body { padding: 12px; }
  .wizard-foot { padding: 10px 12px; flex-wrap: wrap; }
  .wizard-foot .msg { flex: 1 1 100%; }
  .wizard-actions { flex-wrap: nowrap; }
  .wizard-actions > button { flex: 1 1 0; width: auto; min-width: 0; }
  .wizard-actions #wz-finish { margin-left: 0; }
  .wz-term-grid, .wz-price-grid { grid-template-columns: 1fr; }
  .wz-actions { width: 100%; }
  .wz-actions button { flex: 1; }
}
