/* Schrift lokal eingebunden (keine Verbindung zu Google, DSGVO) – Exo 2, SIL Open Font License */
@font-face {
  font-family: "Exo 2"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/exo2-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Exo 2"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/exo2-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design-Tokens von klareprozesse.de */
:root {
  --primary: #023055;
  --primary-light: #003d6e;
  --primary-deep: #011d35;
  --accent: #e4fc57;
  --white: #ffffff;
  --surface: #f2f4f7;
  --line: #e5e7eb;
  --muted: #5b6b7d;
  --warn: #9a6b00;
  --danger: #b42318;
  --header-h: 72px;
  --ease-spring: cubic-bezier(.3, 1.6, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Exo 2", system-ui, sans-serif;
  color: var(--primary);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ================= Header ================= */
.topbar {
  height: var(--header-h);
  background: var(--primary);
  color: var(--white);
  border-radius: 0 0 1rem 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: inherit; flex: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand span {
  font-size: .8rem;
  opacity: .7;
  padding-left: .9rem;
  border-left: 1px solid rgb(255 255 255 / .3);
  white-space: nowrap;
}

.top-spacer { flex: 1; }

/* Suche in der Seitenleiste */
.search-wrap { position: relative; margin-top: 1rem; }
.search {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 .5rem 0 1rem;
  height: 44px;
  cursor: text;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.search:focus-within { background: var(--white); border-color: var(--primary); box-shadow: 0 0 0 4px rgb(228 252 87 / .55); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 2; opacity: .6; flex: none; }
.search:focus-within svg { opacity: 1; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: .92rem; color: var(--primary); }
.search input::placeholder { color: var(--muted); }
.search kbd { font: inherit; font-size: .72rem; color: var(--muted); border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: .05rem .45rem; }
.search:focus-within kbd { display: none; }

.top-actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.user { position: relative; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 40; width: 230px;
  background: var(--white); color: var(--primary); border-radius: 1rem; padding: .9rem;
  box-shadow: 0 24px 50px -20px rgb(1 29 53 / .6); animation: slide .2s var(--ease-out);
}
.user-menu p { font-size: .78rem; color: var(--muted); margin: 0 0 .7rem; line-height: 1.45; }
.user-menu .pill { width: 100%; justify-content: center; color: var(--primary); }
.user-menu .pill:hover { border-color: var(--danger); color: var(--danger); }
.user-badge {
  font-family: inherit; color: var(--white); cursor: pointer;
  font-size: .78rem; padding: .3rem .8rem .3rem .45rem; border-radius: 999px;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .18);
  display: inline-flex; align-items: center; gap: .45rem;
}
.user-badge::before {
  content: ""; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='9' r='4' fill='%23023055'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6' fill='%23023055'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.note-compose-foot input[readonly] { background: transparent; border-color: transparent; color: var(--muted); }
.count { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; padding-left: .5rem; }
.count b { color: var(--accent); font-size: 1.25rem; }
.count span { font-size: .68rem; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }

/* Trefferliste unter der Suche */
.search-pop {
  position: absolute; z-index: 40; top: calc(100% + .5rem); left: 0; width: max(100%, 480px);
  max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--white); color: var(--primary);
  border-radius: 1.1rem; padding: .4rem;
  box-shadow: 0 30px 60px -20px rgb(1 29 53 / .55), 0 0 0 1px rgb(2 48 85 / .06);
  animation: slide .2s var(--ease-out);
}
.sp-group {
  display: flex; align-items: center; gap: .4rem;
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  padding: .7rem .7rem .3rem;
}
.sp-group span { background: var(--surface); border-radius: 999px; padding: 0 .45rem; letter-spacing: 0; }
.sp-item {
  display: flex; gap: .7rem; align-items: flex-start; width: 100%; text-align: left;
  border: 0; background: none; border-radius: .8rem; padding: .55rem .7rem; cursor: pointer;
}
.sp-item:hover, .sp-item.is-cursor { background: var(--surface); }
.sp-item.is-cursor { box-shadow: inset 3px 0 0 var(--accent); }
.sp-item > span { min-width: 0; display: grid; gap: .1rem; }
.sp-item b { font-size: .88rem; font-weight: 600; }
.sp-item small { font-size: .76rem; color: var(--muted); }
.sp-item .sp-snip { color: var(--primary); line-height: 1.45; }
.sp-item .sp-meta { font-size: .68rem; }
.sp-ico { flex: none; width: 26px; height: 26px; border-radius: .5rem; display: grid; place-items: center; background: var(--primary); margin-top: .05rem; }
.sp-pin::after { content: ""; width: 9px; height: 9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); }
.sp-note { background: var(--accent); }
.sp-note::after { content: ""; width: 10px; height: 2px; background: var(--primary); box-shadow: 0 -4px 0 var(--primary), 0 4px 0 var(--primary); }
.sp-dot { background: var(--surface); }
.sp-dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.sp-foot { font-size: .72rem; color: var(--muted); padding: .6rem .7rem .4rem; border-top: 1px solid var(--line); margin-top: .3rem; }
.sp-foot kbd { font: inherit; font-size: .66rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; margin-left: .15rem; }
.sp-empty { font-size: .85rem; color: var(--muted); padding: 1rem; text-align: center; }
mark { background: var(--accent); color: inherit; border-radius: 3px; padding: 0 .1em; }

/* ================= Buttons & Pills ================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  border-radius: 999px;
  padding: .4rem 1rem;
  border: 1px solid var(--line);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.pill:active { transform: scale(.97); }
.pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pill-ghost { color: var(--white); border-color: rgb(255 255 255 / .3); }
.pill-ghost:hover { background: rgb(255 255 255 / .1); }
.pill-primary { background: var(--primary); border-color: var(--primary); color: var(--white); font-weight: 600; }
.pill-primary:hover { background: var(--primary-light); }
.pill-primary:disabled { opacity: .35; cursor: default; transform: none; }

.review-btn { color: var(--primary); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.review-btn:hover, .review-btn.is-active { box-shadow: 0 0 0 4px rgb(228 252 87 / .3); }
.review-btn .warn {
  display: inline-grid; place-items: center;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--primary); color: var(--accent);
  font-size: .7rem; font-weight: 700;
}

/* ================= Layout ================= */
.layout {
  height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 2.25rem clamp(1rem, 2vw, 1.5rem) 1.25rem;
  margin-top: -1rem;
}

/* ================= Sidebar ================= */
.sidebar { display: flex; flex-direction: column; min-height: 0; }
.sidebar-head { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600;
  color: var(--muted); margin-bottom: .75rem;
}
.eyebrow::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2.5px var(--primary);
}
.eyebrow-gap { margin-top: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .78rem; padding: .3rem .8rem; color: var(--primary); }
.chip:hover { border-color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.chip.is-active::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.chip-n { font-size: .7rem; opacity: .55; }

.list-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0 .5rem; font-size: .8rem; font-weight: 600; color: var(--muted);
}
.land-chip { font-size: .72rem; padding: .1rem .6rem; margin-left: .4rem; background: var(--primary); border-color: var(--primary); color: var(--white); }
.link { border: 0; background: none; color: var(--primary); font-size: .8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }

.list { list-style: none; margin: 0 -.5rem; padding: 0 .5rem 1rem; overflow-y: auto; flex: 1; min-height: 0; }
.item {
  display: block; width: 100%; text-align: left;
  border: 1px solid transparent; background: none; border-radius: .9rem;
  padding: .7rem .9rem; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.item:hover, .item.is-hover { background: var(--surface); }
.item.is-active { border-color: var(--primary); background: var(--white); box-shadow: 0 8px 24px -14px rgb(2 48 85 / .55); }
.item-name { font-weight: 600; font-size: .93rem; display: block; line-height: 1.3; }
.item-meta { font-size: .76rem; color: var(--muted); display: block; margin: .15rem 0 .4rem; }
.item-meta .plus { color: var(--primary); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.tag { font-size: .7rem; padding: .12rem .55rem; border-radius: 999px; background: var(--surface); color: var(--primary); }
.tag.hit { background: var(--accent); }
.tag.is-note { background: var(--primary); color: var(--white); }
.item-snip {
  display: block; margin-top: .45rem; font-size: .76rem; line-height: 1.45; color: var(--primary);
  border-left: 2px solid var(--accent); padding-left: .55rem;
}
.item-snip i { font-style: normal; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: .35rem; }
.item-snip em { font-style: normal; font-size: .68rem; color: var(--muted); }
.empty { color: var(--muted); font-size: .9rem; padding: 2rem .5rem; text-align: center; }

/* ================= Karte (Navy) ================= */
.map-area { min-height: 0; }
.map-card {
  position: relative;
  height: 100%;
  border-radius: 1.5rem;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 0%, rgb(228 252 87 / .16), transparent 45%),
    radial-gradient(90% 80% at 0% 100%, rgb(0 61 110 / .9), transparent 60%),
    linear-gradient(160deg, #03365e 0%, var(--primary) 45%, var(--primary-deep) 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06), 0 30px 60px -40px rgb(2 48 85 / .8);
  isolation: isolate;
}
.map-card::after {
  /* feines Raster als Textur */
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgb(255 255 255 / .025) 1px, transparent 1px),
                    linear-gradient(90deg, rgb(255 255 255 / .025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: -1;
}
#map { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
#map.is-panning { cursor: grabbing; }

.dots {
  fill: none; stroke: rgb(255 255 255 / .17); stroke-width: var(--dot, 4px); stroke-linecap: round;
  vector-effect: non-scaling-stroke; transition: stroke .25s ease;
  animation: rise .8s var(--ease-out) backwards; animation-delay: var(--d);
}
.ndots {
  fill: none; stroke: rgb(170 200 230 / .16); stroke-width: calc(var(--dot, 4px) * .72); stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  animation: fadein 1.2s ease backwards; animation-delay: .3s;
}
@keyframes fadein { from { opacity: 0; } }
.nlabel text {
  font-family: "Exo 2", sans-serif; font-size: 10px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  fill: rgb(255 255 255 / .3);
}
#map.has-hover .dots { stroke: rgb(255 255 255 / .1); }
#map .dots.is-hover { stroke: rgb(255 255 255 / .4); }
#map .dots.is-active { stroke: rgb(228 252 87 / .55); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.shape { fill: transparent; cursor: pointer; }
.borders { opacity: 0; transition: opacity .3s; }
.borders path { fill: none; stroke: rgb(255 255 255 / .22); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.spark { stroke: var(--accent); stroke-width: calc(var(--dot, 4px) * 1.15); stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0; }
.spark.go { animation: spark 2s ease-out; }
@keyframes spark { 15% { opacity: .9; } 100% { opacity: 0; } }

/* --- Pins --- */
.pin { cursor: pointer; }
.pin-body {
  transform-origin: 0 0;
  transition: transform .35s var(--ease-spring), opacity .25s;
  animation: drop .6s var(--ease-spring) backwards;
  animation-delay: var(--d);
}
@keyframes drop { from { opacity: 0; transform: translateY(-18px) scale(.5); } }
.pin-shadow { fill: rgb(0 0 0 / .35); transition: transform .35s var(--ease-spring), opacity .25s; transform-box: fill-box; transform-origin: center; }
.pin-head { fill: var(--accent); stroke: var(--primary); stroke-width: 1.8; transition: fill .2s; }
.pin-eye { fill: var(--primary); transition: fill .2s; }
.pin-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pin-glow { fill: var(--accent); opacity: 0; transition: opacity .25s; filter: blur(6px); }

#map.has-pin-hover .pin:not(.is-hover):not(.is-active) .pin-body,
#map.has-selection .pin:not(.is-active):not(.is-hover) .pin-body { opacity: .45; }
.pin.is-hover .pin-body { transform: translateY(-5px) scale(1.4); }
.pin.is-hover .pin-shadow { transform: scale(1.5); opacity: .6; }
.pin.is-hover .pin-glow { opacity: .55; }
.pin.is-hover .pin-ring { animation: ring 1.2s ease-out infinite; }
.pin.is-active .pin-body { transform: translateY(-4px) scale(1.55); }
.pin.is-active .pin-head { fill: var(--white); }
.pin.is-active .pin-glow { opacity: .7; }
.pin.is-active .pin-ring { animation: ring 1.8s ease-out infinite; }
.pin.is-out { display: none; }
@keyframes ring { 0% { transform: scale(.6); opacity: .95; } 100% { transform: scale(2.6); opacity: 0; } }

/* --- Weitere Standorte --- */
.site { fill: rgb(255 255 255 / .5); transition: fill .2s, opacity .2s; }
.site.is-light { fill: rgb(255 255 255 / .3); }
.site-line { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 4; opacity: 0; vector-effect: non-scaling-stroke; transition: opacity .25s; }
.site-group.is-out { display: none; }
#map.has-selection .site-group:not(.is-active):not(.is-hover) .site { opacity: .25; }
.site-group.is-hover .site, .site-group.is-active .site { fill: var(--accent); }
.site-group.is-hover .site-line { opacity: .45; animation: dash 1.2s linear infinite; }
.site-group.is-active .site-line { opacity: .8; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -14; } }

.ghost { opacity: 0; transition: opacity .15s; }
.ghost.show { opacity: 1; }
.ghost path { fill: var(--white); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }

/* --- Overlays auf der Karte --- */
.state-label {
  position: absolute; z-index: 2; top: 1rem; left: 1rem;
  font-size: .78rem; font-weight: 600;
  border-radius: 999px; padding: .35rem .9rem;
  background: rgb(255 255 255 / .1); color: var(--white);
  backdrop-filter: blur(8px); border: 1px solid rgb(255 255 255 / .15);
  opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.state-label.show { opacity: 1; transform: none; }
.state-label i { font-style: normal; color: var(--accent); margin-right: .4rem; }

.pin-tip {
  position: absolute; z-index: 3; pointer-events: none;
  background: var(--white); color: var(--primary);
  font-size: .82rem; font-weight: 600;
  padding: .55rem .85rem; border-radius: .8rem;
  white-space: nowrap;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / .5);
  transform: translate(-50%, calc(-100% - 46px)) scale(.92);
  opacity: 0;
  transition: opacity .18s, transform .25s var(--ease-spring);
}
.pin-tip.show { opacity: 1; transform: translate(-50%, calc(-100% - 46px)); }
.pin-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -5px;
  width: 10px; height: 10px; background: var(--white);
  transform: translateX(-50%) rotate(45deg); border-radius: 2px;
}
.pin-tip span { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); }
.pin-tip em { font-style: normal; display: inline-block; margin-top: .3rem; font-size: .68rem; background: var(--accent); border-radius: 999px; padding: .05rem .5rem; }

.legend {
  position: absolute; z-index: 2; left: 1rem; bottom: 1rem;
  display: flex; gap: 1rem; font-size: .72rem; color: rgb(255 255 255 / .7);
  background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1);
  backdrop-filter: blur(8px); border-radius: 999px; padding: .4rem .9rem;
}
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.lg-pin { width: 9px; height: 9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); box-shadow: 0 0 0 1.5px var(--primary); }
.lg-site { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .6); }

.zoom {
  position: absolute; z-index: 2; right: 1rem; bottom: 1rem;
  display: flex; flex-direction: column;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14);
  backdrop-filter: blur(8px); border-radius: .9rem; overflow: hidden;
}
.zoom button {
  width: 38px; height: 38px; border: 0; background: transparent; color: var(--white);
  font-size: 1.15rem; cursor: pointer; display: grid; place-items: center;
}
.zoom button + button { border-top: 1px solid rgb(255 255 255 / .1); }
.zoom button:hover { background: rgb(255 255 255 / .12); color: var(--accent); }
.zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ================= Prüfliste ================= */
.review {
  position: absolute; z-index: 5; top: .75rem; right: .75rem; bottom: .75rem;
  width: min(440px, calc(100% - 1.5rem));
  display: flex; flex-direction: column;
  background: var(--white); border-radius: 1.25rem;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / .6);
  animation: slide .3s var(--ease-out); overflow: hidden;
}
@keyframes slide { from { opacity: 0; transform: translateY(12px); } }
.review-head { position: relative; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, rgb(228 252 87 / .25), transparent 60%); }
.review-head h2 { font-size: 1.1rem; margin: 0 2.5rem .35rem 0; }
.review-head p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.5; }
.close, .icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); cursor: pointer; font-size: 1.05rem; line-height: 1;
  display: grid; place-items: center; transition: background .15s, transform .2s;
}
.close:hover, .icon-btn:hover { background: var(--surface); transform: rotate(90deg); }
.review .close { position: absolute; top: .9rem; right: .9rem; }
.review-list { list-style: none; margin: 0; padding: .5rem 1rem; overflow-y: auto; flex: 1; counter-reset: r; }
.review-item { padding: .9rem .25rem; border-bottom: 1px solid var(--line); counter-increment: r; }
.review-item:last-child { border-bottom: 0; }
.review-name { font-weight: 600; font-size: .92rem; display: flex; gap: .5rem; }
.review-name::before { content: counter(r); color: var(--muted); font-weight: 400; font-size: .75rem; min-width: 1.2rem; padding-top: .1rem; }
.review-in { font-size: .72rem; color: var(--muted); margin: .2rem 0 0 1.7rem; }
.review-hint { font-size: .78rem; color: #6b5200; background: rgb(228 252 87 / .3); border-radius: .5rem; padding: .4rem .6rem; margin: .5rem 0 0 1.7rem; line-height: 1.45; }
.cands { list-style: none; margin: .5rem 0 0 1.7rem; padding: 0; display: grid; gap: .35rem; }
.cand {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .55rem .7rem; border-radius: .7rem; border: 1px solid var(--line); font-size: .78rem;
  transition: border-color .15s;
}
.cand:hover { border-color: var(--primary); }
.cand.none { color: var(--muted); border-style: dashed; }
.cand b { display: block; font-size: .8rem; }
.cand span { display: block; color: var(--muted); }
.cand a { font-size: .7rem; color: var(--primary); }
.cand em { display: block; font-size: .7rem; color: var(--warn); }
.cand-pick { font-size: .75rem; padding: .25rem .75rem; color: var(--primary); background: var(--white); flex: none; }
.cand-pick:hover { background: var(--accent); border-color: var(--accent); }
.cand-pick:disabled { opacity: .4; cursor: default; }
.review-manual { margin: .5rem 0 0 1.7rem; }
.review-foot { padding: .85rem 1.25rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* ================= Kundenfenster ================= */
.drawer-backdrop {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 30;
  background: rgb(1 29 53 / .18);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 31; top: calc(var(--header-h) + .6rem); right: .75rem; bottom: .75rem;
  width: min(520px, calc(100vw - 1.5rem));
  background: var(--white); border-radius: 1.5rem;
  box-shadow: 0 40px 80px -30px rgb(1 29 53 / .6);
  animation: drawer-in .4s var(--ease-out);
  overflow: hidden;
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(40px); } }
.drawer form { height: 100%; display: flex; flex-direction: column; }
.drawer-head {
  padding: 1.1rem 1.5rem 0;
  background: linear-gradient(160deg, rgb(228 252 87 / .28), transparent 55%);
  border-bottom: 1px solid var(--line);
}
.drawer-top { display: flex; gap: .4rem; align-items: center; }
.drawer-top .icon-btn { margin-left: auto; }
.badge-select {
  appearance: none; -webkit-appearance: none;
  border: 0; border-radius: 999px; cursor: pointer;
  font-size: .72rem; font-weight: 600; padding: .25rem 1.4rem .25rem .7rem;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23023055' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .5rem center / 8px;
}
.badge-select.is-status { background-color: var(--surface); }
.title-input {
  display: block; width: 100%; border: 0; outline: 0; background: transparent; resize: none; overflow: hidden;
  font-size: 1.45rem; font-weight: 700; line-height: 1.25; padding: .6rem 0 .1rem;
  border-bottom: 2px solid transparent; transition: border-color .2s;
}
.title-input:hover { border-bottom-color: var(--line); }
.title-input:focus { border-bottom-color: var(--accent); }
.drawer-meta { margin: .3rem 0 .8rem; font-size: .8rem; color: var(--muted); }
.drawer-meta b { color: var(--primary); font-weight: 600; }
.head-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.head-links a {
  font-size: .78rem; font-weight: 600; color: var(--primary); text-decoration: none;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem;
  transition: background .15s, border-color .15s;
}
.head-links a:hover { background: var(--accent); border-color: var(--accent); }

.tabs { display: flex; gap: 1.25rem; margin-bottom: -1px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: .6rem 0 .7rem;
  font-size: .85rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; white-space: nowrap;
}
.tabs button:hover { color: var(--primary); }
.tabs button.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs span:not(:empty) { font-size: .68rem; background: var(--surface); border-radius: 999px; padding: .05rem .45rem; margin-left: .2rem; }
.tabs .is-active span:not(:empty) { background: var(--accent); }

.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem 1.5rem; }
.drawer-body h3 {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 1.4rem 0 .6rem;
}
.tab-panel > h3:first-child { margin-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-top: 1.4rem; }
.section-head h3 { margin: 0; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 600; font-size: .8rem; cursor: pointer; padding: .2rem .4rem; border-radius: .4rem; }
.link-btn:hover { background: var(--accent); }

.field { display: flex; flex-direction: column; gap: .3rem; font-size: .72rem; color: var(--muted); font-weight: 600; }
.field input, .note-compose textarea, .note-compose input, .person input, .site-row input {
  border: 1px solid var(--line); border-radius: .7rem; background: var(--white);
  padding: .55rem .75rem; font-size: .88rem; font-weight: 400; color: var(--primary);
  outline: 0; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field input:focus, .note-compose input:focus, .person input:focus, .site-row input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgb(228 252 87 / .55);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid-addr { display: grid; grid-template-columns: 1fr 2fr; gap: .75rem; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.field-hint { font-size: .75rem; color: var(--muted); margin: .5rem 0 0; }
.field-hint.warn { color: var(--warn); }

/* Notizen */
.note-compose {
  border: 1px solid var(--line); border-radius: 1rem; padding: .6rem; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.note-compose:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(228 252 87 / .55); background: var(--white); }
.note-compose textarea { border: 0; background: transparent; resize: vertical; min-height: 4.5rem; padding: .3rem .4rem; line-height: 1.5; }
.note-compose-foot { display: flex; gap: .5rem; align-items: center; }
.note-compose-foot input { flex: 1; font-size: .8rem; padding: .4rem .7rem; border-radius: 999px; }
.notes { list-style: none; margin: 1.1rem 0 0 .35rem; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: 1rem; }
.note { position: relative; }
.note::before {
  content: ""; position: absolute; left: calc(-1rem - 6px); top: .3rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--primary);
}
.note-meta { font-size: .72rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.note-meta b { color: var(--primary); }
.note.is-flash .note-text { background: rgb(228 252 87 / .35); box-shadow: 0 0 0 6px rgb(228 252 87 / .35); border-radius: .3rem; }
.note-text { transition: background .6s, box-shadow .6s; font-size: .88rem; line-height: 1.55; margin: .2rem 0 0; white-space: pre-wrap; word-break: break-word; }
.note-del { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .72rem; opacity: 0; transition: opacity .15s; }
.note:hover .note-del, .note-del:focus, .note-del.is-confirm { opacity: 1; }
.note-del.is-confirm { color: var(--danger); font-weight: 600; }
.notes-empty { font-size: .82rem; color: var(--muted); border: 1px dashed #cdd3db; border-radius: .8rem; padding: .9rem; text-align: center; margin-top: 1rem; }

/* Ansprechpartner & Standorte */
.person, .site-row {
  position: relative; border: 1px solid var(--line); border-radius: 1rem; padding: .8rem; margin-top: .6rem;
  display: grid; gap: .5rem;
}
.person { grid-template-columns: 1fr 1fr; }
.person .p-name { grid-column: 1 / -1; font-weight: 600; }
.person input, .site-row input { font-size: .84rem; padding: .45rem .65rem; }
.site-row { grid-template-columns: 90px 1fr 1fr; align-items: center; padding: .55rem; }
.site-row .span-all { grid-column: 1 / -1; }
.row-del {
  position: absolute; top: -.55rem; right: -.55rem;
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--white);
  cursor: pointer; font-size: .8rem; color: var(--muted); opacity: 0; transition: opacity .15s;
}
.person:hover .row-del, .site-row:hover .row-del, .row-del:focus { opacity: 1; }
.row-del:hover { color: var(--danger); border-color: var(--danger); }
.empty-row { font-size: .8rem; color: var(--muted); margin: .6rem 0 0; }
.quick-links { display: flex; gap: .4rem; flex-wrap: wrap; grid-column: 1 / -1; }
.quick-links a {
  font-size: .72rem; text-decoration: none; color: var(--primary);
  border: 1px solid var(--line); border-radius: 999px; padding: .15rem .6rem;
}
.quick-links a:hover { background: var(--accent); border-color: var(--accent); }

.leist-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.leist-grid h3 { margin-top: 0; }
.leist-grid > div + div h3 { margin-top: 1rem; }
.notes-title { margin-top: 1.6rem !important; padding-top: 1.2rem; border-top: 1px solid var(--line); }

/* Tag-Eingabe */
.tag-input {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  border: 1px solid var(--line); border-radius: .9rem; padding: .45rem; min-height: 46px;
}
.tag-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(228 252 87 / .55); }
.tag-input .tag { font-size: .78rem; padding: .25rem .4rem .25rem .7rem; display: inline-flex; gap: .3rem; align-items: center; background: var(--accent); }
.tag-input .tag button { border: 0; background: none; cursor: pointer; font-size: .85rem; line-height: 1; padding: 0 .15rem; color: var(--primary); }
.tag-input input { flex: 1; min-width: 140px; border: 0; outline: 0; font-size: .85rem; padding: .25rem .3rem; }
.suggest { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.suggest button { font-size: .72rem; border: 1px dashed #cdd3db; background: none; border-radius: 999px; padding: .15rem .6rem; cursor: pointer; color: var(--muted); }
.suggest button:hover { border-color: var(--primary); color: var(--primary); }
.recherche { font-size: .78rem; color: var(--muted); line-height: 1.5; background: var(--surface); border-radius: .8rem; padding: .75rem .9rem; }
.recherche a { color: var(--primary); }

.drawer-foot {
  display: flex; gap: .5rem; align-items: center; justify-content: flex-end;
  padding: .85rem 1.5rem; border-top: 1px solid var(--line); background: var(--white);
}
.save-state { margin-right: auto; font-size: .78rem; color: var(--muted); }
.save-state.is-dirty { color: var(--warn); font-weight: 600; }
.save-state.is-ok { color: #2f7a39; }

.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 1.5rem;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--primary); color: var(--white); font-size: .85rem; font-weight: 500;
  padding: .65rem 1.1rem; border-radius: 999px; box-shadow: 0 16px 40px -16px rgb(1 29 53 / .7);
  transition: opacity .25s, transform .35s var(--ease-spring); max-width: calc(100vw - 2rem);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-warn { background: var(--accent); color: var(--primary); }

/* ================= Responsive ================= */
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; height: auto; padding-block: .8rem; gap: .75rem; }
  .top-actions { margin-left: auto; }
  .layout { height: auto; grid-template-columns: 1fr; }
  .map-area { height: 72vh; }
  .sidebar { order: 2; }
  .list { max-height: 60vh; }
}
@media (max-width: 560px) {
  .brand span, .count span { display: none; }
  .grid-2, .person { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .site-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
