/* 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;
  width: 330px !important;
  min-width: 330px;
  max-width: 330px;
  max-height: min(62vh, 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: 360px !important;
    min-width: 360px;
    max-width: 360px;
    max-height: min(40vh, 360px);
  }
}

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: 36px;
  height: 36px;
  top: 8px;
  right: 8px;
  font-size: 22px;
  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: 28px;
  max-height: 108px;
  overflow: hidden;
  padding: 8px 10px 4px;
  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: 12px;
  font-weight: 600;
  color: var(--ff-ink, #171a15);
  margin-bottom: 4px;
}

html.ff-app-v2 .ff-score-compact-findable .fl-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 72px;
  overflow-y: auto;
}

html.ff-app-v2 .ff-score-compact-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 40px 4px 12px;
  min-height: 44px;
  flex: none;
}

html.ff-app-v2 .ff-score-compact-num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  flex: none;
  min-width: 2.2ch;
  font-variant-numeric: tabular-nums;
}

html.ff-app-v2 .ff-score-compact-num.is-loading {
  font-size: 12px;
  font-weight: 600;
  color: var(--ff-muted, #6b7368);
  min-width: 0;
}

html.ff-app-v2 .ff-score-compact-row1 .pp-tone-chip {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
}

html.ff-app-v2 .ff-score-compact-place {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.ff-app-v2 .ff-score-compact-best {
  margin: 0;
  padding: 0 12px 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  flex: none;
}

html.ff-app-v2 .ff-score-compact-narrative,
html.ff-app-v2 .score-compact-card-inner .score-narrative {
  margin: 0;
  padding: 0 12px 4px;
  flex: none;
  min-height: 2.6em;
  max-height: 2.6em;
  overflow: hidden;
}

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

html.ff-app-v2 .ff-score-compact-timeline {
  padding: 0 12px 2px;
  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: 4px;
  padding: 4px 8px 10px;
  border-top: 1px solid var(--ff-hairline, #e2e4dc);
  flex: none;
}

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

html.ff-app-v2 .ff-score-compact-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ff-ink, #171a15);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
}

html.ff-app-v2 .ff-score-compact-act-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ff-hairline, #e2e4dc);
  background: var(--ff-paper, #f2f3ee);
  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:active {
  background: var(--ff-paper, #f2f3ee);
}

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;
}
