/* Compact score panel as Leaflet popup (Issue #1003, #1016) */
html.ff-app-v2 .leaflet-container .ff-score-compact-popup.leaflet-popup {
  margin-bottom: 0;
  filter: drop-shadow(0 8px 24px rgba(23, 26, 21, 0.18));
}

html.ff-app-v2 .ff-score-compact-popup .leaflet-popup-content-wrapper {
  background: var(--ff-white, #fff);
  color: var(--ff-ink, #171a15);
  border: 1px solid var(--ff-hairline, #e2e4dc);
  border-radius: 16px;
  padding: 0;
  box-shadow: none;
}

html.ff-app-v2 .ff-score-compact-popup .leaflet-popup-content {
  margin: 0 !important;
  width: 330px !important;
  min-width: 330px;
  max-width: 330px;
  max-height: min(70vh, 520px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  html.ff-app-v2 .ff-score-compact-popup .leaflet-popup-content {
    width: 338px !important;
    min-width: 338px;
    max-width: 338px;
    max-height: min(70vh, 520px);
  }
}

html.ff-app-v2 .ff-score-compact-popup .leaflet-popup-tip-container {
  pointer-events: none;
}

html.ff-app-v2 .ff-score-compact-popup .leaflet-popup-close-button {
  width: 30px;
  height: 30px;
  top: 6px;
  right: 6px;
  font-size: 20px;
  color: var(--ff-muted, #6b7368);
  z-index: 2;
}

html.ff-app-v2 .score-compact-card-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  overflow: hidden;
}

html.ff-app-v2 .score-compact-card-inner .wow-remind-wrap {
  display: none !important;
}

html.ff-app-v2 .ff-score-compact-findable-wrap {
  flex: none;
  min-height: 24px;
  overflow: hidden;
  padding: 8px 40px 0 10px;
  box-sizing: border-box;
}

html.ff-app-v2 .ff-score-compact-findable {
  padding: 0;
}

html.ff-app-v2 .ff-score-compact-findable-h {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ff-muted, #6b7368);
  line-height: 12px;
  margin-bottom: 3px;
}

/* Arten als Chips im Fluss (Name und Score), höchstens zwei Zeilen, kein Scrollbalken. Den Rest
   ersetzt map.js (fitCompactFindableChips) durch den Chip "+N", der die Details öffnet. */
html.ff-app-v2 .ff-score-compact-findable .fl-chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  overflow: visible;
}

html.ff-app-v2 .ff-score-compact-findable .fl-chip {
  min-height: 26px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 3px 9px 3px 8px;
  border-radius: 13px;
  border: 1px solid var(--ff-hairline, #e2e4dc);
  background: var(--ff-white, #fff);
  font-size: 12.5px;
  font-weight: 600;
  gap: 5px;
}

html.ff-app-v2 .ff-score-compact-findable .fl-chip--more {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ff-brand, #3d8b6e);
  cursor: pointer;
  margin: 0;
  justify-content: center;
}

html.ff-app-v2 .ff-score-compact-findable .fl-chip .dot {
  width: 8px;
  height: 8px;
}

html.ff-app-v2 .ff-score-compact-findable .fl-chip .fs {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

html.ff-app-v2 .ff-score-compact-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 36px 0 10px;
  min-height: 52px;
  flex: none;
}

/* Score-Ring (Entwurf A): Füllung = Score/100, Farbe aus der Score-Skala. */
html.ff-app-v2 .ff-score-ring {
  position: relative;
  display: inline-block;
  flex: none;
}
html.ff-app-v2 .ff-score-ring svg {
  display: block;
  transform: rotate(-90deg);
}
html.ff-app-v2 .ff-score-ring .ff-ring-t { stroke: var(--ff-hairline-soft, #efece5); }
html.ff-app-v2 .ff-score-ring .ff-ring-v { transition: stroke-dasharray .25s; }
html.ff-app-v2 .ff-score-ring .ff-score-compact-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 400;
  letter-spacing: -.02em;
}

html.ff-app-v2 .ff-score-compact-num {
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  flex: none;
  font-variant-numeric: tabular-nums;
}

html.ff-app-v2 .ff-score-compact-num.is-loading {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  padding: 0 8px;
  color: var(--ff-muted, #6b7368);
}

html.ff-app-v2 .ff-score-compact-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

html.ff-app-v2 .ff-score-compact-sub {
  display: flex;
  align-items: center;
  gap: 6px;
}

html.ff-app-v2 .ff-score-compact-row1 .pp-tone-chip {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  line-height: 1.3;
}

html.ff-app-v2 .ff-score-compact-place {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

html.ff-app-v2 .ff-score-compact-place--two {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

html.ff-app-v2 .ff-score-compact-loc {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ff-muted, #6b7368);
}

/* Habitat in einer Zeile: Baumarten oder Fläche, dann Höhe. */
html.ff-app-v2 .ff-score-compact-hab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px 0;
  font-size: 12.5px;
  line-height: 16px;
  color: #3a3f35;
  flex: none;
  min-width: 0;
}
html.ff-app-v2 .ff-score-compact-hab[hidden] { display: none; }
html.ff-app-v2 .ff-score-compact-hab .ff-hab-ico {
  width: 15px;
  height: 15px;
  flex: none;
  color: #2c4a2e;
}
html.ff-app-v2 .ff-score-compact-hab span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.ff-app-v2 .ff-score-compact-best {
  margin: 0;
  padding: 6px 12px 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ff-forest, #2c4a2e);
  flex: none;
}

html.ff-app-v2 .ff-score-compact-narrative,
html.ff-app-v2 .score-compact-card-inner .score-narrative {
  margin: 0;
  padding: 2px 12px 0;
  flex: none;
  min-height: 0;
  overflow: visible;
}

html.ff-app-v2 .ff-score-compact-narrative p,
html.ff-app-v2 .score-compact-card-inner .score-narrative p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

html.ff-app-v2 .ff-score-compact-timeline {
  padding: 6px 12px 0;
  touch-action: pan-x;
  flex: none;
}

html.ff-app-v2 .ff-score-compact-timeline .timeline {
  margin: 0;
  max-width: none;
}

html.ff-app-v2 .ff-score-compact-timeline .timeline svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: none !important;
  /* Höhe folgt der viewBox, damit der Verlauf die volle Breite nutzt (Refs #1022). */
  aspect-ratio: auto;
}

html.ff-app-v2 .ff-score-compact-timeline .timeline {
  position: relative;
}

/* Wie Live (map.css .score-shell--v2), nur kleiner (Refs #1022). */
html.ff-app-v2 .ff-score-compact-timeline .tl-bar--past { filter: saturate(.72); }
html.ff-app-v2 .ff-score-compact-timeline .tl-bar--active { opacity: 1 !important; stroke: #3f6b28; stroke-width: 1.2; }
html.ff-app-v2 .ff-score-compact-timeline .tl-bar--best:not(.tl-bar--past) { filter: saturate(1.08) brightness(.92); }
html.ff-app-v2 .ff-score-compact-timeline .tl-day { fill: #7a8276; font-weight: 500; font-size: 10px; }
html.ff-app-v2 .ff-score-compact-timeline .tl-day--past { fill: #a8ada4; opacity: .9; }
html.ff-app-v2 .ff-score-compact-timeline .tl-day--active,
html.ff-app-v2 .ff-score-compact-timeline .tl-day--today { fill: #3f6b28; font-weight: 600; }

html.ff-app-v2 .ff-score-compact-timeline .tl-scrub-tip {
  position: absolute;
  top: -24px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 8px;
  background: #1a1f18;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
  z-index: 3;
}

html.ff-app-v2 .ff-score-compact-timeline .tl-scrub-tip[hidden] {
  display: none !important;
}


html.ff-app-v2 .ff-score-compact-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px 10px;
  flex: none;
}

html.ff-app-v2 .ff-score-compact-all-findable {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ff-brand, #3d8b6e);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

/* Flache Knöpfe (höchstens 52 px): Symbol über der Beschriftung. */
html.ff-app-v2 .ff-score-compact-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 48px;
  padding: 0 2px;
  border: 1px solid var(--ff-hairline, #e2e4dc);
  border-radius: 14px;
  background: var(--ff-white, #fff);
  color: var(--ff-ink, #171a15);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  min-width: 0;
}

html.ff-app-v2 .ff-score-compact-act-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

html.ff-app-v2 .ff-score-compact-act-lbl {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.ff-app-v2 .ff-score-compact-act-icon .ff-ico {
  width: 20px;
  height: 20px;
}

html.ff-app-v2 .ff-score-compact-act.pp-action-find {
  background: var(--ff-gold-deep, #8c6420);
  border-color: var(--ff-gold-deep, #8c6420);
  color: #fff;
}

html.ff-app-v2 .ff-score-compact-act:active {
  background: var(--ff-paper, #f2f3ee);
}
html.ff-app-v2 .ff-score-compact-act.pp-action-find:active {
  background: var(--ff-gold-ink, #5e4313);
}

html.ff-app-v2 .ff-score-compact-dock-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1590;
  background: rgba(23, 26, 21, 0.35);
  pointer-events: auto;
}

html.ff-app-v2.ff-score-compact-dock-open #ffV2ScoreDock {
  z-index: 1605;
}

/* Artname im kompakten Popup umbrechen statt mit Ellipse abschneiden (Refs #1185). */
html.ff-app-v2 .ff-score-compact-findable .fl-chip .fn {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
