/* ──────────────────────────────────────────────────────────────────────
   Component styles for Location Scout
   ────────────────────────────────────────────────────────────────────── */

/* ── Pills ───────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill--sm { height: 18px; padding: 0 7px; font-size: 11px; gap: 4px; }
.pill--lg { height: 26px; padding: 0 11px 0 10px; font-size: 13px; }

.pill--neutral { background: var(--bg-2); color: var(--fg-mute); border-color: var(--line); }
.pill--muted   { background: transparent; color: var(--fg-faint); border-color: var(--line); }
.pill--active  { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-line); }
.pill--ok      { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill--warn    { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill--bad     { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }

.pill__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 1.6s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── ModePill ────────────────────────────────────────────────────────── */
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 4px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
}
.mode-pill__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 16px;
  border-radius: 4px;
  background: var(--bg-0);
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: 1px solid var(--line);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-3);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background .12s ease, border-color .12s ease, transform .04s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn--lg { height: 40px; padding: 0 16px; font-size: 14.5px; }
.btn--full { width: 100%; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}
.btn--primary:hover:not(:disabled) { background: var(--accent-2); }

.btn--secondary {
  background: var(--bg-1);
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn--secondary:hover:not(:disabled) { background: var(--bg-2); border-color: var(--line-vivid); }

.btn--ghost {
  background: transparent;
  color: var(--fg);
}
.btn--ghost:hover:not(:disabled) { background: var(--bg-2); }

.btn--danger {
  background: transparent;
  color: var(--bad);
  border-color: var(--bad-line);
}
.btn--danger:hover:not(:disabled) { background: var(--bad-soft); }

.btn__icon, .btn__trailing { display: inline-flex; }

/* IconButton */
.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-3);
  color: var(--fg-mute);
  transition: background .12s, color .12s;
}
.ibtn--sm { width: 26px; height: 26px; }
.ibtn--lg { width: 36px; height: 36px; }
.ibtn:hover { background: var(--bg-2); color: var(--fg); }
.ibtn--danger:hover { background: var(--bad-soft); color: var(--bad); }

/* ── Fields ──────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
}
.field__wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  transition: border-color .12s, background .12s;
}
.field__wrap:focus-within {
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__leading, .field__trailing {
  display: inline-flex;
  color: var(--fg-mute);
  flex-shrink: 0;
}
.field__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  height: 100%;
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
}
.field__input::placeholder { color: var(--fg-faint); }
.field__hint { font-size: 12px; color: var(--fg-mute); }
.field__wrap--select .field__input { appearance: none; padding-right: 0; cursor: pointer; }

.textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  outline: 0;
  transition: border-color .12s;
}
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Einzeiliges Feld. Die Klasse wurde im Wizard benutzt, war aber NIE definiert
   — das Feld erbte damit den Browser-Standard und stand weiss im dunklen
   Formular. Teilt sich bewusst die Werte mit .textarea, damit beide nicht
   auseinanderlaufen. */
.input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  outline: 0;
  transition: border-color .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--fg-faint, #6b7280); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* .auth-input — Anmelde-Dialog und die meisten Wizard-Felder.
   War NUR in public/app-classic.html definiert, der Legacy-SPA, die per 301
   weggeleitet wird; beim Herausloesen der CSS blieb sie dort liegen. Damit
   liefen 20 Felder der Live-App auf Browser-Standard: heller Hintergrund,
   fremde Schrift, keine Fokus-Anzeige. Teilt sich die Werte mit .input, damit
   die drei Feld-Klassen nicht auseinanderlaufen. */
.auth-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  outline: 0;
  transition: border-color .12s;
}
textarea.auth-input { resize: vertical; min-height: 96px; }
.auth-input::placeholder { color: var(--fg-faint, #6b7280); }
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Tabs (segmented) ────────────────────────────────────────────────── */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-mute);
  transition: background .12s, color .12s;
}
.tabs__tab:hover { color: var(--fg); }
.tabs__tab.is-active {
  background: var(--bg-2);
  color: var(--fg);
  box-shadow: var(--shadow-1);
}
.tabs__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--bg-3);
  color: var(--fg-mute);
}
.tabs__tab.is-active .tabs__count { background: var(--accent-soft); color: var(--accent-2); }

/* ── Tooltip ──────────────────────────────────────────────────────────── */
.tt { position: relative; display: inline-flex; }
.tt::after {
  content: attr(data-tt);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--bg-3);
  color: var(--fg);
  font-size: 11.5px;
  white-space: nowrap;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 50;
}
.tt:hover::after { opacity: 1; }

/* ── Card ────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-1);
}
.card--p { padding: 20px; }

/* ── Criteria check row ──────────────────────────────────────────────── */
.ccr {
  display: grid;
  grid-template-columns: 24px 1fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.ccr:first-child { border-top: 0; }
.ccr__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
}
.ccr--pass .ccr__dot { background: var(--ok-soft); color: var(--ok); }
.ccr--fail .ccr__dot { background: var(--bad-soft); color: var(--bad); }
.ccr--partial .ccr__dot { background: var(--warn-soft); color: var(--warn); }
.ccr__label { font-weight: 500; }

/* ── Contact card ────────────────────────────────────────────────────── */
.contact {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 14px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  align-items: start;
}
.contact__logo {
  width: 36px; height: 36px;
  border-radius: var(--r-2);
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.contact__name { font-weight: 600; font-size: 13.5px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.contact__action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--fg-mute);
}
.contact__action:hover { color: var(--fg); text-decoration: none; }
.contact__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: start;
  padding: 4px 8px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg-1);
  color: var(--fg-mute);
  font-size: 11.5px;
}
.contact__source:hover { color: var(--accent); border-color: var(--accent-line); text-decoration: none; }

/* ── Context chips ───────────────────────────────────────────────────── */
.ctx-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.ctx-chip {
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.ctx-chip__k { margin-bottom: 4px; }
.ctx-chip__v { font-size: 13.5px; font-weight: 500; }

/* ── Export menu ─────────────────────────────────────────────────────── */
.exp { position: relative; display: inline-flex; }
.exp__primary, .exp__caret {
  height: 34px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.exp__primary { padding: 0 12px; border-radius: var(--r-3) 0 0 var(--r-3); border-right-width: 0; }
.exp__caret { padding: 0 8px; border-radius: 0 var(--r-3) var(--r-3) 0; }
.exp__primary:hover, .exp__caret:hover { background: var(--bg-2); }
.exp__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  padding: 5px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-pop);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exp__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  font-size: 13px;
  text-align: left;
}
.exp__item:hover { background: var(--bg-3); }

/* ── Avatar ──────────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: white;
  flex-shrink: 0;
}
/* Redesign: Initialen neutral statt bunter Verläufe — Farbe trägt Bedeutung, kein Schmuck. */
.avatar--indigo, .avatar--emerald, .avatar--amber, .avatar--graphite, .avatar--rose { background: var(--surface-2); color: var(--ink-2); }

/* ── Score bar ───────────────────────────────────────────────────────── */
.score {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.score--accent .score__fill { background: var(--accent); }
.score--ok .score__fill { background: var(--ok); }
.score--warn .score__fill { background: var(--warn); }
.score__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 999px;
}
.score__label {
  position: absolute;
  right: -28px;
  top: -7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 600;
}

/* ── App-Rahmen: Seitenleiste + Kopfzeile (Redesign 2026-10) ─────────── */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.brandmark {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--ink);
}
.brandmark > span { width: 8px; height: 8px; transform: rotate(45deg); border: 2px solid var(--surface); }

.sb {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  gap: 2px;
  overflow: hidden;
}
.sb__brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 18px; }
.sb__brand-name { font: 500 17px/1 var(--serif); white-space: nowrap; }
.sb__group { display: flex; flex-direction: column; gap: 2px; }
.sb__item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px; border-radius: 7px;
  font: 400 13.5px var(--sans); color: var(--ink-2);
  white-space: nowrap; text-align: left; width: 100%;
  transition: background .1s, color .1s;
}
.sb__item:hover { background: var(--surface-2); color: var(--ink); }
.sb__item.is-active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.sb__item-ico { flex: none; width: 16px; display: inline-flex; justify-content: center; color: var(--ink-2); }
.sb__item-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb__count { font: 500 11.5px var(--mono); color: var(--ink-3); }
.sb__spacer { flex: 1; }
.sb__user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 5px 0; margin-top: 6px; border-top: 1px solid var(--line);
}
.sb__avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 11px var(--sans);
}
.sb__avatar--btn { cursor: pointer; }
.sb__user-txt { flex: 1; min-width: 0; }
.sb__user-name { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__signin { font: 500 13px var(--sans); color: var(--accent); padding: 0; }
.sb__lang {
  display: inline-flex; gap: 1px; padding: 2px; border-radius: 6px;
  background: var(--surface-2); font: 600 10.5px var(--mono);
}
.sb__lang button { padding: 3px 6px; border-radius: 4px; color: var(--ink-3); }
.sb__lang button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sb__collapse {
  margin-top: 8px; height: 30px; flex: none; width: 100%;
  border: 1px solid var(--line); border-radius: 7px; background: transparent;
  color: var(--ink-2); font: 500 13px var(--mono); cursor: pointer;
}
.sb__collapse:hover { background: var(--surface-2); color: var(--ink); }

/* Rechtliche Links: Seitenleiste, Anmeldung, geteilte Berichte. */
.legal-links { display: flex; flex-wrap: wrap; gap: 2px 10px; font: 400 11px/1.5 var(--sans); }
.legal-links a { color: var(--ink-3); text-decoration: none; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; }
.legal-links__mark { display: none; }
.sb__legal { flex: none; padding: 8px 5px 0; }
.legal-links--auth { justify-content: center; margin-top: 16px; }
.legal-links--foot { display: none; justify-content: center; padding: 20px 16px 28px; }

/* Schiene (nur Desktop). Unter 820 px ist die Leiste eine Schublade (app2.css). */
@media (min-width: 821px) {
  .is-sb-rail .sb__legal { justify-content: center; padding: 8px 0 0; }
  .is-sb-rail .sb__legal a:not(:first-child),
  .is-sb-rail .sb__legal .legal-links__lbl { display: none; }
  .is-sb-rail .sb__legal .legal-links__mark { display: inline; font-size: 13px; }
  .app.is-sb-rail { grid-template-columns: 56px 1fr; }
  .is-sb-rail .sb__brand { justify-content: center; padding: 0 0 18px; }
  .is-sb-rail .sb__brand-name,
  .is-sb-rail .sb__item-lbl,
  .is-sb-rail .sb__count,
  .is-sb-rail .sb__user-txt,
  .is-sb-rail .sb__lang { display: none; }
  .is-sb-rail .sb__item { justify-content: center; padding: 0; gap: 0; }
  .is-sb-rail .sb__user { justify-content: center; padding: 10px 0 0; }
}
@media (max-width: 820px) {
  .sb__collapse { display: none; }
  .legal-links--foot { display: flex; }
}

/* ── Hauptspalte ────────────────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  z-index: 5;
  flex: none;
}
.topbar__crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.topbar__crumb { color: var(--ink-3); white-space: nowrap; }
.topbar__sep { color: var(--ink-3); }
.topbar__title { color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 821px) {
  .topbar--mobile-only { display: none; }
}
.viewport {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* ── Generic helpers ─────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
  border: 0;
}
.vdivider {
  width: 1px;
  align-self: stretch;
  background: var(--line);
}
.section-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
