/* =========================================================
   Kommentar-Modus (nur Prototyp)
   ========================================================= */
.proto-bar__inner { align-items: center; }
.cm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.proto-bar__inner > .proto-toggle { margin-left: auto; }
.cm-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid var(--grau-300); background: var(--weiss); color: var(--schwarz);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700;
}
.cm-btn:hover { border-color: var(--schwarz); }
.cm-btn--primary { background: var(--violett); border-color: var(--violett); color: var(--weiss); }
.cm-btn--primary:hover { background: var(--violett-dunkel); border-color: var(--violett-dunkel); }
.cm-btn[aria-pressed="true"] { background: var(--schwarz); border-color: var(--schwarz); }
.cm-count { background: var(--violett); color: var(--weiss); border-radius: 999px; min-width: 20px; padding: 0 6px; font-size: 12px; text-align: center; }

.cm-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 45; }
.cm-hidden .cm-layer { display: none; }
.cm-pin {
  position: absolute; translate: -50% -50%;
  width: 30px; height: 30px; border-radius: 50% 50% 50% 4px;
  background: var(--violett); color: var(--weiss); border: 2px solid var(--weiss);
  font: 800 13px/1 "Montserrat", sans-serif; cursor: pointer;
  box-shadow: 0 4px 14px rgba(29,29,27,.35); display: grid; place-items: center;
  transition: transform .15s var(--ease);
}
.cm-pin:hover, .cm-pin.is-open { transform: scale(1.15); background: var(--schwarz); }
.cm-pin.is-done { background: var(--grau-600); }
.cm-pin--static { position: static; translate: none; flex: none; cursor: inherit; box-shadow: none; }

.cm-placing, .cm-placing a, .cm-placing button:not(.cm-btn):not(.link-btn) { cursor: crosshair !important; }
.cm-placing [data-anchor]:hover { outline: 2px dashed var(--violett); outline-offset: -2px; }
.cm-placing .card:hover { transform: none; }
.cm-placing .card:hover .card__overlay { opacity: 0; }
.cm-hint {
  position: fixed; left: 50%; bottom: 20px; translate: -50% 0; z-index: 70;
  background: var(--schwarz); color: var(--weiss); padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center;
  width: max-content; max-width: calc(100vw - 32px);
}
.cm-hint .link-btn { color: #c9cdf2; }

.cm-pop {
  position: absolute; z-index: 60; width: 340px; max-width: calc(100vw - 24px);
  background: var(--weiss); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 20px 60px rgba(29,29,27,.28); border: 1px solid var(--grau-300); font-size: 14px;
}
.cm-pop__title { font-weight: 800; font-size: 15px; display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.cm-pop__title span { font-weight: 600; font-size: 12px; color: var(--grau-600); flex: 1; }
.cm-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; color: var(--grau-600); }
.cm-form { display: grid; gap: 8px; }
.cm-input {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 11px; resize: vertical;
  border: 1.5px solid var(--grau-300); border-radius: var(--radius-sm); background: var(--grau-100);
}
.cm-input:focus { outline: none; border-color: var(--violett); background: var(--weiss); }
.cm-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.cm-actions .cm-btn { padding: 7px 14px; }
.cm-error { color: #a4161a; font-weight: 600; font-size: 13px; }
.cm-msgs { display: grid; gap: 12px; max-height: 300px; overflow: auto; margin-bottom: 12px; }
.cm-msg + .cm-msg { padding-top: 12px; border-top: 1px solid var(--grau-300); }
.cm-msg__meta { font-size: 12px; color: var(--grau-600); display: flex; gap: 4px; align-items: baseline; }
.cm-msg__meta strong { color: var(--schwarz); }
.cm-del { margin-left: auto; font-size: 12px; color: var(--grau-600); }
.cm-msg__text { white-space: pre-wrap; margin-top: 3px; overflow-wrap: anywhere; }

.cm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 65; width: min(400px, 100vw);
  background: var(--weiss); box-shadow: -10px 0 40px rgba(29,29,27,.2); overflow: auto; padding: 0 0 30px;
}
.cm-drawer__head { position: sticky; top: 0; background: var(--weiss); display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 12px; border-bottom: 1px solid var(--grau-300); }
.cm-drawer__head h2 { font-size: 22px; }
.cm-drawer__tools { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 20px; font-size: 13px; }
.cm-note { margin: 12px 20px 0; font-size: 13px; background: #fff4c2; color: #6b5300; padding: 8px 10px; border-radius: var(--radius-sm); }
.cm-empty { padding: 20px; color: var(--grau-600); font-size: 14px; }
.cm-sub { font-size: 14px; padding: 18px 20px 4px; color: var(--grau-600); text-transform: uppercase; letter-spacing: .08em; }
.cm-rows { list-style: none; margin: 0; padding: 0 12px; display: grid; gap: 4px; }
.cm-row { width: 100%; display: flex; gap: 12px; text-align: left; background: none; border: 0; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.cm-row:hover { background: var(--grau-100); }
.cm-row.is-done { opacity: .65; }
.cm-row__body { display: grid; gap: 2px; min-width: 0; }
.cm-row__meta, .cm-row__where { font-size: 12px; color: var(--grau-600); }
.cm-row__where { color: var(--violett); font-weight: 600; }
.cm-row__text { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .cm-bar { margin-left: 0; width: 100%; }
  .proto-bar__inner > .proto-toggle { margin-left: 0; }
  .cm-pop { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: none; border-radius: var(--radius) var(--radius) 0 0; max-height: 75vh; overflow: auto; }
  .cm-hint { border-radius: var(--radius); }
}


/* ---------- Prototyp-Leiste (für beide Varianten gleich) ---------- */
.proto-bar { background: #ececf1; font: 500 13px/1.4 "Montserrat", system-ui, sans-serif; color: #55565e; position: relative; z-index: 60; }
.proto-bar__inner { display: flex; justify-content: space-between; gap: 12px 18px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; align-items: center; }
.proto-bar strong { color: #161616; }
.proto-toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 600; }
.ab-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ab-switch__btns { display: inline-flex; background: #fff; border-radius: 999px; padding: 2px; border: 1px solid #d6d6de; }
.ab-switch button {
  border: 0; background: none; cursor: pointer; font: 700 12px/1 "Montserrat", sans-serif;
  padding: 5px 12px; border-radius: 999px; color: #55565e;
}
.ab-switch button[aria-pressed="true"] { background: #161616; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cm-pin, .cm-pop, .cm-drawer, .cm-hint, .cm-btn { font-family: "Montserrat", system-ui, sans-serif; }
