/* Zenya Explorer shell – shares tokens with Kudos shell */

.zenya-explorer-app {
  --zenya-accent: #20b2aa;
  --zenya-accent-dark: #188f89;
  --zenya-text: #25282d;
  --zenya-muted: #747980;
  --zenya-border: #dedfe1;
  --zenya-background: #ffffff;

  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #eef0f2;
  color: var(--zenya-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  font-size: 14px;
  z-index: 1;
}

.zenya-explorer-app * {
  box-sizing: border-box;
}

/* Header — above toolbar so More dropdown is not covered */
.zenya-explorer-header {
  position: relative;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--zenya-background);
  border-bottom: 1px solid var(--zenya-border);
  border-top: 4px solid var(--zenya-accent);
  flex-shrink: 0;
  min-height: 48px;
}

.zenya-explorer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto; /* may use leftover space; mark itself does not shrink */
  min-width: 0;
  position: relative;
  z-index: 3;
}

.zenya-explorer-mark {
  color: var(--zenya-accent);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  display: block;
  flex-shrink: 0;
}

.zenya-explorer-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12em; /* can shrink; never force-hide via media query */
  min-width: 0;
}

.zenya-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 7px 10px; /* match Filter / More height */
  line-height: 1;
}

.zenya-search-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Full-header search panel (sibling of brand/actions — not nested in the right group) */
.zenya-search-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: var(--zenya-background);
  border: 1px solid var(--zenya-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.zenya-search-overlay[hidden] {
  display: none !important;
}

.zenya-search-overlay .zenya-explorer-search {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 8px 6px;
}

.zenya-search-overlay .zenya-explorer-search:focus {
  outline: none;
  border: none;
}

.zenya-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 36px;
  padding: 7px 10px;
  font-size: 20px;
  line-height: 1;
}

.zenya-explorer-header.zenya-search-active .zenya-explorer-brand,
.zenya-explorer-header.zenya-search-active .zenya-explorer-header-actions {
  visibility: hidden;
}

.zenya-explorer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.zenya-explorer-toolbar[hidden] {
  display: none !important;
}

.zenya-library-menu-wrap {
  position: relative;
  z-index: 1;
}

.zenya-library-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  padding: 6px;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zenya-library-menu[hidden] {
  display: none !important;
}

.zenya-library-menu button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--zenya-text);
}

.zenya-library-menu button:hover {
  background: #f0faf9;
  color: var(--zenya-accent-dark);
}

/* Map-mounted Heat + basemap (top-right Leaflet control) */
.zenya-map-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin: 10px;
  clear: both;
}

.zenya-map-tool-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--zenya-border, #dedfe1);
  border-radius: 7px;
  padding: 7px 12px;
  background: #fff;
  color: var(--zenya-text, #25282d);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  line-height: 1.2;
}

.zenya-map-tool-btn:hover {
  border-color: var(--zenya-accent, #20b2aa);
}

.zenya-map-tool-btn.active {
  border-color: var(--zenya-accent, #20b2aa);
  color: var(--zenya-accent-dark, #188f89);
  background: #f0faf9;
}

.zenya-map-tools .zenya-basemap-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  overflow: hidden;
}

.zenya-map-tools .zenya-basemap-tabs .zenya-map-tool-btn {
  border-radius: 0;
  box-shadow: none;
  padding: 7px 10px;
}

.zenya-map-tools .zenya-basemap-tabs .zenya-map-tool-btn + .zenya-map-tool-btn {
  border-left-width: 0;
}

.zenya-map-tools .zenya-basemap-tabs .zenya-map-tool-btn + .zenya-map-tool-btn.active,
.zenya-map-tools .zenya-basemap-tabs .zenya-map-tool-btn.active + .zenya-map-tool-btn {
  border-left-width: 1px;
}

.zenya-explorer-btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--zenya-border);
  border-radius: 7px;
  padding: 7px 12px;
  background: #f7f8f8;
  color: var(--zenya-text);
  cursor: pointer;
}

.zenya-explorer-btn:hover {
  border-color: var(--zenya-accent);
  background: #fff;
}

.zenya-explorer-btn-primary {
  background: var(--zenya-accent);
  border-color: var(--zenya-accent);
  color: #fff;
  font-weight: 700;
}

.zenya-explorer-btn-primary:hover {
  background: var(--zenya-accent-dark);
}

.zenya-explorer-btn.active {
  border-color: var(--zenya-accent);
  color: var(--zenya-accent-dark);
  background: #fff;
}

/* Search bar – must sit above Leaflet map panes */
.zenya-explorer-toolbar {
  position: relative;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px;
  background: var(--zenya-background);
  border-bottom: 1px solid var(--zenya-border);
  flex-shrink: 0;
}

.zenya-explorer-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.zenya-explorer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zenya-explorer-preset {
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--zenya-border);
  background: #f7f8f8;
  color: var(--zenya-text);
  cursor: pointer;
}

.zenya-explorer-preset:hover {
  border-color: var(--zenya-accent);
}

.zenya-explorer-preset.active {
  background: var(--zenya-accent);
  border-color: var(--zenya-accent);
  color: #fff;
}

.zenya-explorer-search {
  flex: 1;
  min-width: 160px;
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--zenya-border);
  border-radius: 7px;
  background: #fff;
}

.zenya-explorer-search:focus {
  outline: none;
  border-color: var(--zenya-accent);
}

.zenya-explorer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.zenya-explorer-pill {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--zenya-border);
  background: #fff;
  color: var(--zenya-text);
  cursor: pointer;
}

.zenya-explorer-pill:hover {
  border-color: var(--zenya-accent);
}

/* Filter popover */
.zenya-explorer-filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 6px;
  z-index: 3000;
}

.zenya-explorer-filter-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 600;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--zenya-text);
}

.zenya-explorer-filter-menu button:hover {
  background: #f0faf9;
  color: var(--zenya-accent-dark);
}

.zenya-explorer-filter-wrap {
  position: relative;
}

.zenya-explorer-filter-editor {
  z-index: 4000;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  width: min(320px, 92vw);
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 12px;
  z-index: 3000;
}

.zenya-explorer-filter-editor h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.zenya-explorer-filter-editor label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--zenya-muted);
  margin-bottom: 8px;
}

.zenya-explorer-filter-editor input,
.zenya-explorer-filter-editor select {
  font: inherit;
  padding: 7px 8px;
  border: 1px solid var(--zenya-border);
  border-radius: 6px;
}

.zenya-explorer-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow: auto;
}

.zenya-explorer-option-list button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--zenya-border);
  background: #f7f8f8;
  cursor: pointer;
}

.zenya-explorer-option-list button.active {
  background: var(--zenya-accent);
  border-color: var(--zenya-accent);
  color: #fff;
}

/* Body: map / list */
.zenya-explorer-body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.zenya-explorer-map {
  position: absolute;
  inset: 0;
}

.zenya-explorer-list {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 12px 16px 72px;
  background: #eef0f2;
}

.zenya-explorer-list[hidden],
.zenya-explorer-map[hidden],
.zenya-explorer-stats[hidden] {
  display: none !important;
}

.zenya-explorer-stats {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 12px 16px 72px;
  background: #eef0f2;
}

.zenya-stats-panel {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zenya-stats-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.zenya-stats-totals > div {
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zenya-stats-totals strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--zenya-text);
}

.zenya-stats-totals span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zenya-muted);
}

.zenya-stats-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zenya-stats-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--zenya-muted);
}

.zenya-stats-bucket-tabs {
  display: inline-flex;
  gap: 0;
}

.zenya-stats-bucket-tabs .zenya-explorer-btn {
  border-radius: 0;
  padding: 6px 12px;
  font-size: 12px;
}

.zenya-stats-bucket-tabs .zenya-explorer-btn:first-child {
  border-radius: 7px 0 0 7px;
}

.zenya-stats-bucket-tabs .zenya-explorer-btn:last-child {
  border-radius: 0 7px 7px 0;
}

.zenya-stats-bucket-tabs .zenya-explorer-btn + .zenya-explorer-btn {
  border-left-width: 0;
}

.zenya-stats-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.zenya-stats-card {
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 8px;
  padding: 12px 14px 14px;
  border-top: 3px solid var(--zenya-accent);
}

.zenya-stats-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.zenya-stats-muted {
  font-weight: 600;
  color: var(--zenya-muted);
}

.zenya-stats-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.zenya-stats-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--zenya-muted);
}

.zenya-stats-bar-col {
  flex: 1 0 14px;
  min-width: 10px;
  max-width: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.zenya-stats-bar-col:hover .zenya-stats-bar {
  background: var(--zenya-accent-dark, #188f89);
}

.zenya-stats-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--zenya-accent);
  min-height: 2px;
}

.zenya-stats-bar-label {
  font-size: 9px;
  color: var(--zenya-muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zenya-stats-empty {
  font-size: 12px;
  color: var(--zenya-muted);
  padding: 12px 0;
}

.zenya-stats-type-mix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zenya-stats-type-row {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.zenya-stats-type-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zenya-stats-type-track {
  height: 8px;
  background: #eef0f2;
  border-radius: 4px;
  overflow: hidden;
}

.zenya-stats-type-fill {
  height: 100%;
  background: var(--zenya-accent);
  border-radius: 4px;
}

.zenya-stats-type-n {
  text-align: right;
  color: var(--zenya-muted);
  font-variant-numeric: tabular-nums;
}

.zenya-stats-card-table {
  grid-column: 1 / -1;
}

.zenya-stats-table-wrap {
  overflow: auto;
  max-height: min(480px, 55vh);
  border: 1px solid var(--zenya-border);
  border-radius: 6px;
}

.zenya-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.zenya-stats-table th {
  position: sticky;
  top: 0;
  background: #f7f8f8;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--zenya-border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--zenya-muted);
}

.zenya-stats-table th.sorted {
  color: var(--zenya-accent-dark);
}

.zenya-stats-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #eef0f2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zenya-stats-table .zenya-stats-name {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zenya-stats-row {
  cursor: pointer;
}

.zenya-stats-row:hover {
  background: #f0faf9;
}

.zenya-stats-row.selected {
  background: #e6f7f5;
}

.zenya-stats-row.focused {
  outline: 2px solid var(--zenya-accent);
  outline-offset: -2px;
}

@media (max-width: 800px) {
  .zenya-stats-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .zenya-stats-charts {
    grid-template-columns: 1fr;
  }
}

/* List cards – match Kudos .zenya-kudos-review-item typography */
.zenya-explorer-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 7px;
  padding: 9px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.zenya-explorer-card:hover {
  border-color: var(--zenya-accent);
}

.zenya-explorer-card-map {
  width: 88px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--zenya-border);
  background: #fafafa;
}

.zenya-explorer-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.zenya-explorer-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.zenya-explorer-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--zenya-accent);
}

.zenya-explorer-type-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  overflow: visible;
}

.zenya-explorer-card-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.zenya-explorer-card-metrics {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--zenya-text);
}

.zenya-explorer-card-meta {
  margin-top: 3px;
  color: var(--zenya-muted);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 400;
}

.zenya-explorer-card-media {
  cursor: pointer;
  border: 0;
  background: none;
  font: inherit;
  padding: 0;

  margin-top: 3px;
  color: var(--zenya-accent);
  font-size: 11px;
  line-height: 1.3;
}

/* Contextual selection + Similar (above summary) */
.zenya-selection-bar {
  position: relative;
  z-index: 2500;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #f0faf9;
  border-top: 1px solid var(--zenya-border);
}

.zenya-selection-bar[hidden] {
  display: none !important;
}

.zenya-selection-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--zenya-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Summary footer */
.zenya-explorer-summary {
  position: relative;
  z-index: 2000;
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--zenya-background);
  border-top: 1px solid var(--zenya-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--zenya-text);
}

/* Bottom view nav (Strava-style) */
.zenya-bottom-nav {
  position: relative;
  z-index: 3000;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: var(--zenya-background);
  border-top: 1px solid var(--zenya-border);
}

.zenya-bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--zenya-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.zenya-bottom-nav-btn .zenya-bottom-nav-icon {
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
}

.zenya-bottom-nav-btn.active {
  color: var(--zenya-accent-dark);
  background: #e8f7f6;
}

.zenya-bottom-nav-btn.active .zenya-bottom-nav-icon {
  opacity: 1;
}

.zenya-bottom-nav-btn:active {
  background: #eef0f2;
}

/* Empty state */
.zenya-explorer-empty {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #eef0f2;
}

.zenya-explorer-empty[hidden] {
  display: none !important;
}

.zenya-explorer-empty p {
  margin: 0;
  color: var(--zenya-muted);
  max-width: 320px;
}

/* Leaflet.Draw toolbar icons (unpkg spritesheet) */
.zenya-explorer-app .leaflet-draw-toolbar a {
  background-image: url("https://unpkg.com/leaflet-draw@1.0.4/dist/images/spritesheet.png");
  background-image: linear-gradient(transparent, transparent),
    url("https://unpkg.com/leaflet-draw@1.0.4/dist/images/spritesheet.svg");
  background-repeat: no-repeat;
  color: transparent !important;
}

.zenya-explorer-app .leaflet-draw-toolbar a:hover {
  background-color: #f4f4f4;
}


/* legacy header view-tabs removed — use .zenya-bottom-nav */

/* Soften only on true phone widths — do not hide the wordmark at the old 640px cut. */
@media (max-width: 480px) {
  .zenya-explorer-header {
    padding: 6px 10px;
    gap: 6px;
  }

  .zenya-explorer-title {
    max-width: 7em; /* ellipsis if needed; still visible */
    font-size: 16px;
  }

  .zenya-search-overlay {
    left: 6px;
    right: 6px;
  }

  .zenya-explorer-toolbar {
    padding: 6px 12px;
    gap: 6px;
  }

  .zenya-explorer-summary {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Very narrow phones: prefer mark + actions over full wordmark */
@media (max-width: 360px) {
  .zenya-explorer-title {
    display: none;
  }
}

/* Calendar view */
.zenya-explorer-calendar {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 12px 16px 24px;
  background: #eef0f2;
}

.zenya-explorer-calendar[hidden] {
  display: none !important;
}

.zenya-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 14px;
}

.zenya-cal-year-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zenya-cal-year {
  font-size: 20px;
  font-weight: 700;
  min-width: 4ch;
  text-align: center;
}

.zenya-cal-year-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-left: auto;
}

.zenya-cal-year-stats div {
  display: flex;
  flex-direction: column;
  min-width: 4.5rem;
}

.zenya-cal-year-stats strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--zenya-accent-dark);
  line-height: 1.2;
}

.zenya-cal-year-stats span {
  font-size: 11px;
  color: var(--zenya-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zenya-cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.zenya-cal-month {
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 10px;
  padding: 10px 12px 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.zenya-cal-month.selected {
  border-color: var(--zenya-accent);
  box-shadow: 0 0 0 1px var(--zenya-accent);
}

.zenya-cal-month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  margin: 0 0 10px;
}

.zenya-cal-month-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--zenya-muted);
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.zenya-cal-month-name:hover {
  color: var(--zenya-accent-dark);
  text-decoration: underline;
}

.zenya-cal-month {
  cursor: pointer;
}

.zenya-cal-month .zenya-cal-bars,
.zenya-cal-month .zenya-cal-day {
  cursor: inherit;
}

.zenya-cal-month .zenya-cal-day.has-activity {
  cursor: pointer;
}

.zenya-cal-month-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--zenya-muted);
}

.zenya-cal-month-hours {
  font-size: 12px;
  font-weight: 600;
  color: var(--zenya-text);
}

.zenya-cal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
}

.zenya-cal-day {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
  position: relative;
}

.zenya-cal-day.has-activity {
  cursor: pointer;
}

.zenya-cal-day.has-activity::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar, 0%);
  background: #1c1e21;
  border-radius: 1px 1px 0 0;
  min-height: 3px;
}

.zenya-cal-day.selected.has-activity::after {
  background: var(--zenya-accent);
}

/* List multi-select reflected on calendar (not a day filter) */
.zenya-cal-day.has-selection::after {
  box-shadow: 0 0 0 2px #0d9488;
}

.zenya-cal-mday.has-selection {
  outline: 1px solid rgba(13, 148, 136, 0.45);
  outline-offset: -1px;
}

.zenya-cal-mact.selected {
  background: rgba(32, 178, 170, 0.18);
}

.zenya-cal-selection-banner {
  font-size: 12px;
  color: var(--zenya-muted, #666);
  padding: 4px 12px 8px;
}

.zenya-cal-day.has-activity:hover::after {
  background: var(--zenya-accent-dark);
}

.zenya-cal-tooltip {
  position: absolute;
  z-index: 30;
  transform: translate(-50%, 0); /* below the day bar; month titles stay clear */
  min-width: 180px;
  max-width: 280px;
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-top: 3px solid var(--zenya-accent);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  padding: 8px 10px;
  font-size: 12px;
  pointer-events: auto;
}

.zenya-cal-tip-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid var(--zenya-border);
}

.zenya-cal-tip-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.zenya-cal-tip-row:first-child {
  padding-top: 0;
}

.zenya-cal-tip-row strong {
  font-size: 13px;
  line-height: 1.3;
}

.zenya-cal-tip-row span {
  color: var(--zenya-muted);
}

.zenya-cal-tip-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.zenya-cal-tip-actions button,
.zenya-cal-tip-actions a {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--zenya-accent-dark);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}


/* Month detail grid */
.zenya-cal-weekday {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.zenya-cal-weekday span {
  font-size: 11px;
  font-weight: 600;
  color: var(--zenya-muted);
  text-align: center;
}

.zenya-cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.zenya-cal-mday {
  min-height: 88px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--zenya-border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zenya-cal-mday.empty {
  background: transparent;
  border-color: transparent;
}

.zenya-cal-mday.has-activity {
  cursor: pointer;
}

.zenya-cal-mday.selected {
  border-color: var(--zenya-accent);
  box-shadow: 0 0 0 1px var(--zenya-accent);
}

.zenya-cal-mday-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--zenya-muted);
}

.zenya-cal-mday-acts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow: auto;
}

.zenya-cal-mact {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  border-radius: 4px;
  background: #f0faf9;
  color: var(--zenya-text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  padding: 3px 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zenya-cal-mact:hover {
  background: var(--zenya-accent);
  color: #fff;
}


.zenya-cal-mact.focused {
  background: var(--zenya-accent);
  color: #fff;
}


.zenya-explorer-card.focused {
  border-color: var(--zenya-accent);
  box-shadow: 0 0 0 2px var(--zenya-accent);
}

.zenya-explorer-card.selected {
  border-color: #0d9488;
  background: rgba(32, 178, 170, 0.06);
}

.zenya-explorer-card.selected.focused {
  border-color: var(--zenya-accent);
  box-shadow: 0 0 0 2px var(--zenya-accent);
}


.zenya-explorer-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.zenya-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f0f1f2;
  color: var(--zenya-muted);
  border: 1px solid var(--zenya-border);
}

.zenya-badge-private {
  background: #fff4e5;
  border-color: #f0c36d;
  color: #8a5a00;
}

.zenya-badge-flagged {
  background: #fde8e8;
  border-color: #e0a0a0;
  color: #8b1e1e;
}


.zenya-explorer-card-desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--zenya-text);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zenya-explorer-card-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--zenya-muted);
  font-style: italic;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zenya-explorer-card-details {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--zenya-text);
}

.zenya-detail-label {
  font-weight: 700;
  color: var(--zenya-muted);
  margin-right: 4px;
}

@media (max-width: 640px) {
  .zenya-explorer-card-details {
    grid-template-columns: 1fr;
  }
}


.zenya-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--zenya-text);
}

.zenya-range-dual {
  position: relative;
  height: 28px;
  margin-bottom: 10px;
}

.zenya-range-dual input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  pointer-events: none;
  appearance: none;
  background: transparent;
  height: 28px;
}

.zenya-range-dual input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--zenya-border);
  border-radius: 2px;
}

.zenya-range-dual input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--zenya-accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--zenya-border);
  margin-top: -6px;
  pointer-events: auto;
  cursor: pointer;
}

.zenya-range-dual input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--zenya-border);
  border-radius: 2px;
}

.zenya-range-dual input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--zenya-accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--zenya-border);
  pointer-events: auto;
  cursor: pointer;
}

.zenya-range-numbers {
  display: flex;
  gap: 10px;
}

.zenya-range-numbers label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.zenya-range-numbers input {
  width: 100%;
}


.zenya-perf-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--zenya-border);
}

.zenya-perf-block:first-of-type {
  margin-top: 8px;
}

.zenya-perf-block h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--zenya-text);
}


.zenya-badge-similar {
  background: #e6f7f5;
  border-color: var(--zenya-accent);
  color: var(--zenya-accent-dark);
  margin-left: 6px;
}

.zenya-card-strava {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--zenya-accent-dark);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--zenya-border);
  background: #fff;
}

.zenya-card-strava:hover {
  border-color: var(--zenya-accent);
  background: #f0faf9;
}

.zenya-similar-seed {
  font-size: 12px;
  margin: 0 0 10px;
  color: var(--zenya-muted);
}

.zenya-similar-hint {
  font-size: 11px;
  color: var(--zenya-muted);
  margin: 8px 0;
}

.zenya-similar-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}


/* Selected activity pin — sits above cluster stacks */
.zenya-focused-pin {
  background: transparent !important;
  border: none !important;
}

.zenya-focused-pin-dot {
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  border-radius: 50%;
  background: var(--zenya-accent, #20b2aa);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* Secondary multi-select pins (not the primary focus) */
.zenya-selected-pin .zenya-focused-pin-dot {
  background: #0d9488;
  width: 14px;
  height: 14px;
  margin: 4px;
  border-width: 2px;
}

/* Direction chevrons for selected routes (detail zoom only) */
.zenya-dir-arrow {
  background: transparent !important;
  border: none !important;
  pointer-events: none;
}

.zenya-dir-arrow__shape {
  display: block;
  width: 18px;
  height: 18px;
  transform-origin: 50% 60%;
  overflow: visible;
}


.zenya-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.zenya-card-media-btn,
.zenya-popup-media {
  border: 1px solid var(--zenya-border);
  background: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  color: var(--zenya-text);
}

.zenya-card-media-btn:hover,
.zenya-popup-media:hover {
  border-color: var(--zenya-accent);
  background: #f0faf9;
}

.zenya-card-strava {
  margin-left: 0;
}

.zenya-popup-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

/* Leaflet popup — zenya window chrome (accent bar on top) */
.zenya-explorer-app .leaflet-popup-content-wrapper {
  border-top: 4px solid var(--zenya-accent);
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  padding: 0;
  overflow: hidden;
}

.zenya-explorer-app .leaflet-popup-content {
  margin: 10px 14px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--zenya-text);
}

.zenya-explorer-app .leaflet-popup-tip {
  /* keep default tip; accent is on the wrapper only */
}
