/* ═══════════════════════════════════════════════════════════════════════════
   HOME VIEW — Activity Feed  (append to style.css)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tab panel ── */
#tabHome {
  display: none;
  flex-direction: column;
  height: 100%;
  background: var(--color-dark--1, #2d3439);
  /* When inactive: pass-through (same as other panels) */
  pointer-events: none !important;
}
/* Home extends under the status bar so content scrolls beneath it (Strava-style) */
#tabHome.tab-panel--active {
  display: flex;
  /* When active: BLOCK all pointer events — prevent clicks reaching Leaflet map */
  pointer-events: all !important;
  justify-content: flex-start !important;
}
#tabHome .home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 100px;
  -webkit-overflow-scrolling: touch;
  pointer-events: all !important;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* ── Greeting ── */
.home-greeting {
  padding: 24px 20px 8px;
}
.home-greeting__text {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-light--1, #aaa);
  margin: 0 0 4px;
}
.home-greeting__text strong {
  color: #fff;
  font-weight: 700;
}
.home-greeting__sub {
  font-size: 1.2rem;
  color: var(--color-light--2, #6c7175);
  margin: 0;
}

/* ── Loading ── */
.home-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}
.home-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--color-brand--2, #00c46a);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.home-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}
.home-empty__icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.home-empty__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-light--1, #aaa);
  margin: 0 0 8px;
}
.home-empty__sub {
  font-size: 1.3rem;
  color: var(--color-light--2, #6c7175);
  margin: 0;
}

/* ── Activity Card ── */
.home-card {
  margin: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.home-card:active {
  transform: scale(0.985);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card header */
.home-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}
.home-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.home-card__meta {
  flex: 1;
  min-width: 0;
}
.home-card__name {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-card__time {
  font-size: 1.1rem;
  color: var(--color-light--2, #6c7175);
}
.home-card__badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.home-card__badge {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.home-card__sport-badge {
  font-size: 1.05rem;
  text-transform: capitalize;
  opacity: 0.7;
}

/* Description */
.home-card__desc {
  font-size: 1.3rem;
  color: var(--color-light--1, #aaa);
  padding: 8px 16px 0;
  margin: 0;
  line-height: 1.5;
}

/* Mini map */
.home-card__map-wrap {
  margin: 12px 16px;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  position: relative;
}
.home-card__no-map {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-light--2, #6c7175);
  font-size: 1.2rem;
}

/* Photo */
.home-card__photo {
  margin: 0 16px 12px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  height: 260px;
}
.home-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.2s;
}
.home-card__photo:active img {
  opacity: 0.85;
}

/* Video preview inside label — must not capture clicks (label handles them) */
.sam-photo-zone video,
.pm-photo-zone video {
  pointer-events: none;
}

/* Video in feed card — same container as photo */
.home-card__photo video {
  width:       100%;
  height:      100%;
  object-fit:  cover;
  display:     block;
  border-radius: 14px;
}

/* Media size hint shown below upload zone */
.sam-media-hint {
  display:     block;
  font-size:   1.1rem;
  color:       var(--color-light--2, #6c7175);
  margin-top:  6px;
  text-align:  center;
}

/* Stats row */
.home-card__stats {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 0;
}
.home-card__stat {
  flex: 1;
  text-align: center;
}
.home-card__stat-val {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.home-card__stat-lbl {
  display: block;
  font-size: 1.05rem;
  color: var(--color-light--2, #6c7175);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.home-card__stat-sep {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.08);
}

/* Notes */
.home-card__notes {
  padding: 0 16px 12px;
  font-size: 1.2rem;
  color: var(--color-light--2, #6c7175);
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

/* Footer */
.home-card__footer {
  display: flex;
  align-items: center;
  padding: 10px 16px;
}
.home-card__action {
  background: none;
  border: none;
  color: var(--color-light--2, #6c7175);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.home-card__action svg {
  width: 20px;
  height: 20px;
}
.home-card__action--liked {
  color: #f87171;
}
.home-card__action--liked svg {
  fill: #f87171;
  stroke: #f87171;
}

/* Desktop layout for Home tab */
@media (min-width: 900px) {
  #tabHome .home-scroll {
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 40px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SAVE ACTIVITY MODAL  (bottom sheet)
   ═══════════════════════════════════════════════════════════════════════════ */

.sam-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: flex-end;
  transition: background 0.3s ease;
  pointer-events: none;
  opacity: 0;
}
.sam-overlay--visible {
  opacity: 1;
  background: rgba(0,0,0,0.65);
  pointer-events: auto;
}
.sam-sheet {
  width: 100%;
  max-height: 92vh;
  background: #1e2528;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.5);
}
.sam-sheet--open {
  transform: translateY(0);
}

/* Handle */
.sam-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
  cursor: grab;
}

/* Header */
.sam-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
}
.sam-header__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.08);
}
.sam-header__info {
  flex: 1;
}
.sam-header__type {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}
.sam-header__hint {
  display: block;
  font-size: 1.2rem;
  color: var(--color-light--2, #6c7175);
}
.sam-close {
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--color-light--1, #aaa);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.sam-close:hover { background: rgba(255,255,255,0.12); }

/* Scrollable body */
.sam-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
  -webkit-overflow-scrolling: touch;
}

/* Fields */
.sam-field {
  margin-bottom: 22px;
}
.sam-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-light--2, #6c7175);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.sam-input,
.sam-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: #fff;
  font-size: 1.45rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
}
.sam-input::placeholder,
.sam-textarea::placeholder {
  color: rgba(255,255,255,0.2);
}
.sam-input:focus,
.sam-textarea:focus {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.04);
}
.sam-textarea--sm {
  font-size: 1.3rem;
}

/* Photo zone */
.sam-photo-zone {
  position: relative;
  height: 120px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
}
.sam-photo-zone:hover,
.sam-photo-zone--filled {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.04);
}
.sam-photo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.sam-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.25);
  pointer-events: none;
}
.sam-photo-placeholder svg {
  width: 32px;
  height: 32px;
}
.sam-photo-placeholder span {
  font-size: 1.2rem;
}
.sam-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sport buttons */
.sam-sport-btns {
  display: flex;
  gap: 8px;
}
.sam-sport-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--color-light--1, #aaa);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sam-sport-btn--active {
  background: color-mix(in srgb, var(--sb-color, #00c46a) 15%, transparent);
  border-color: var(--sb-color, #00c46a);
  color: var(--sb-color, #00c46a);
}

/* Single sport selector button (opens categorized picker) */
.sam-sport-select {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--sb-color, rgba(255,255,255,0.15));
  background: color-mix(in srgb, var(--sb-color, #00c46a) 10%, transparent);
  color: var(--color-light--1, #fff);
  font-family: inherit; font-size: 1.6rem; font-weight: 700;
  cursor: pointer;
}
.sam-sport-select__icon  { font-size: 2.2rem; line-height: 1; }
.sam-sport-select__label { flex: 1; text-align: left; }
.sam-sport-select__chevron { opacity: 0.55; }

/* Visibility buttons */
.sam-vis-btns {
  display: flex;
  gap: 8px;
}
.sam-vis-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--color-light--1, #aaa);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sam-vis-btn--active {
  background: color-mix(in srgb, #00c46a 15%, transparent);
  border-color: #00c46a;
  color: #00c46a;
}

/* Mute checkbox row */
.sam-mute-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
}
.sam-mute-check {
  width: 20px; height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #00c46a;
  cursor: pointer;
}
.sam-mute-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sam-mute-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--app-text-primary, #fff);
}
.sam-mute-sub {
  font-size: 1.15rem;
  color: var(--app-text-tertiary, rgba(255,255,255,0.5));
  line-height: 1.4;
}

/* Intensity slider */
.sam-intensity-track {
  position: relative;
  padding-bottom: 12px;
}
.sam-intensity-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}
.sam-intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.15s;
}
.sam-intensity-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}
.sam-intensity-dots {
  display: flex;
  justify-content: space-between;
  padding: 6px 3px 0;
}
.sam-idot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s;
}
.sam-intensity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}
.sam-intensity-label {
  margin-left: 8px;
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: color 0.3s;
}

/* Map preview in modal */
.sam-map-preview {
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
}
.sam-no-map {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 1.3rem;
}

/* Footer */
.sam-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px 28px;
  background: var(--app-bg-card, #1e2528);
  border-top: 1px solid var(--app-border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.sam-btn {
  flex: 1;
  padding: 15px 0;
  border-radius: 16px;
  border: none;
  font-size: 1.45rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.15s;
}
.sam-btn:active { transform: scale(0.97); }
.sam-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sam-btn--cancel {
  background: rgba(255,255,255,0.07);
  color: var(--color-light--1, #aaa);
  flex: 0 0 auto;
  padding: 15px 20px;
}
.sam-btn--save {
  color: #fff;
  flex: 1;
  letter-spacing: 0.2px;
}

/* ── Bottom nav Home icon ── */
.bottom-nav__item[data-tab="tabHome"] .bottom-nav__icon-home-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  background: var(--color-brand--2, #00c46a);
  border-radius: 50%;
  border: 1.5px solid var(--color-dark--1, #2d3439);
  display: none;
}
.bottom-nav__item[data-tab="tabHome"].has-new .bottom-nav__icon-home-dot {
  display: block;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Leaflet z-index fix inside modals ── */
.sam-map-preview .leaflet-pane,
.home-card__map-wrap .leaflet-pane {
  z-index: 1 !important;
}
.sam-map-preview .leaflet-top,
.sam-map-preview .leaflet-bottom,
.home-card__map-wrap .leaflet-top,
.home-card__map-wrap .leaflet-bottom {
  z-index: 2 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   COMMENT PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.home-card__comment-panel {
  border-top: 1px solid rgba(255,255,255,0.07);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
  opacity: 0;
}
.home-card__comment-panel--open {
  max-height: 360px;
  opacity: 1;
}
.hcc__list {
  padding: 12px 16px 0;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hcc__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 8px 12px;
}
.hcc__text {
  font-size: 1.3rem;
  color: var(--color-light--1, #ccc);
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}
.hcc__ts {
  font-size: 1.05rem;
  color: var(--color-light--2, #666);
  flex-shrink: 0;
  margin-top: 2px;
}
.hcc__empty {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.2);
  text-align: center;
  padding: 12px 0;
  margin: 0;
}
.hcc__form {
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
  align-items: center;
}
.hcc__input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  color: #fff;
  font-size: 1.3rem;
  padding: 9px 16px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.hcc__input:focus {
  border-color: var(--color-brand--2, #00c46a);
}
.hcc__input::placeholder { color: rgba(255,255,255,0.2); }
.hcc__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-brand--2, #00c46a);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}
.hcc__send:hover { opacity: 0.88; }
.hcc__send:active { transform: scale(0.92); }


/* ═══════════════════════════════════════════════════════════════════════════
   SHARE PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.home-card__share-panel {
  border-top: 1px solid rgba(255,255,255,0.07);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
  opacity: 0;
}
.home-card__share-panel--open {
  max-height: 220px;
  opacity: 1;
}
.hcs__title {
  padding: 12px 16px 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.hcs__options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 14px;
}
.hcs__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: var(--color-light--1, #ccc);
  font-size: 1.35rem;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  width: 100%;
}
.hcs__opt:hover { background: rgba(255,255,255,0.06); color: #fff; }
.hcs__opt:active { background: rgba(255,255,255,0.1); }
.hcs__opt--disabled {
  opacity: 0.3;
  pointer-events: none;
}
.hcs__opt--loading {
  opacity: 0.6;
  pointer-events: none;
}
.hcs__opt svg {
  flex-shrink: 0;
  color: var(--color-brand--2, #00c46a);
}


/* ═══════════════════════════════════════════════════════════════════════════
   ACTION BUTTONS — updated styles
   ═══════════════════════════════════════════════════════════════════════════ */

.home-card__footer {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 4px;
}
.home-card__action {
  background: none;
  border: none;
  color: var(--color-light--2, #6c7175);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, background 0.15s;
  font-family: inherit;
}
.home-card__action:hover {
  background: rgba(255,255,255,0.05);
  color: var(--color-light--1, #aaa);
}
.home-card__action svg { flex-shrink: 0; }
.home-card__action-count {
  font-size: 1.15rem;
  font-weight: 600;
  min-width: 12px;
}

/* Like — active */
.home-card__action--liked {
  color: #f87171;
}
.home-card__action--liked svg {
  fill: #f87171;
  stroke: #f87171;
}

/* Pulse animation on like */
@keyframes likeP {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.home-card__action--pulse svg {
  animation: likeP 0.38s ease;
}

/* Comment — active */
.home-card__action--comment.active {
  color: #60a5fa;
}

/* Share — active */
.home-card__action--share.active {
  color: var(--color-brand--2, #00c46a);
}

/* Spacer between like/comment and share */
.home-card__action--share {
  margin-left: auto;
}


/* ═══════════════════════════════════════════════════════════════════════════
   FIXES: prevent card click from triggering workout form
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Core fix: tab container blocks pass-through when active ── */
#tabHome.tab-panel--active {
  pointer-events: all !important;
}
/* Scroll area is interactive */
#tabHome.tab-panel--active .home-scroll {
  pointer-events: all !important;
}
/* Cards are interactive */
#tabHome.tab-panel--active .home-card {
  pointer-events: all !important;
}
/* All buttons/inputs inside cards are clickable */
#tabHome.tab-panel--active .home-card button,
#tabHome.tab-panel--active .home-card input,
#tabHome.tab-panel--active .home-card textarea,
#tabHome.tab-panel--active .home-card a,
#tabHome.tab-panel--active .home-card img,
#tabHome.tab-panel--active .home-card__action,
#tabHome.tab-panel--active .home-card__footer,
#tabHome.tab-panel--active .home-card__comment-panel,
#tabHome.tab-panel--active .home-card__share-panel,
#tabHome.tab-panel--active .hcc__form,
#tabHome.tab-panel--active .hcc__input,
#tabHome.tab-panel--active .hcc__send,
#tabHome.tab-panel--active .hcs__opt {
  pointer-events: all !important;
}
/* Leaflet panes inside mini-maps: disable so they don't swallow taps meant for buttons */
#tabHome .home-card__map-wrap .leaflet-pane,
#tabHome .home-card__map-wrap .leaflet-overlay-pane,
#tabHome .home-card__map-wrap .leaflet-marker-pane,
#tabHome .home-card__map-wrap .leaflet-map-pane,
#tabHome .home-card__map-wrap .leaflet-tile-pane,
#tabHome .home-card__map-wrap .leaflet-tile-container,
#tabHome .home-card__map-wrap canvas,
#tabHome .home-card__map-wrap svg {
  pointer-events: none !important;
}
/* When inactive — never intercept anything */
#tabHome:not(.tab-panel--active),
#tabHome:not(.tab-panel--active) * {
  pointer-events: none !important;
}
#tabHome { isolation: isolate; }

/* Photo pointer-events — must be clickable for lightbox */
#tabHome .home-card__photo,
#tabHome .home-card__photo img {
  pointer-events: all !important;
  cursor: pointer !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PHOTO LIGHTBOX
   ═══════════════════════════════════════════════════════════════════════════ */

.home-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.home-lightbox--open {
  opacity: 1;
  pointer-events: all;
}
.home-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.home-lightbox__inner {
  position: relative;
  z-index: 1;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-lightbox__img {
  max-width: 96vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7);
  display: block;
  transform: scale(0.92);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.home-lightbox--open .home-lightbox__img {
  transform: scale(1);
}
.home-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  pointer-events: all;
}
.home-lightbox__close:hover { background: rgba(255,255,255,0.22); }


/* ═══════════════════════════════════════════════════════════════════════════
   GREETING ROW — profile button in top-right
   ═══════════════════════════════════════════════════════════════════════════ */

.home-greeting {
  padding: 20px 16px 8px;
}
.home-greeting__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.home-greeting__text-wrap {
  flex: 1;
  min-width: 0;
}
/* Override old single-line rules */
.home-greeting__text {
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--color-light--1, #aaa);
  margin: 0 0 3px;
}
.home-greeting__text strong { color: var(--app-text-primary, #fff); font-weight: 700; }
.home-greeting__sub {
  font-size: 1.15rem;
  color: var(--color-light--2, #6c7175);
  margin: 0;
}

/* Profile avatar button */
.home-greeting__profile-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.12));
  background: var(--app-surface-1, rgba(255,255,255,0.06));
  color: var(--app-text-tertiary, rgba(255,255,255,0.5));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
  pointer-events: all !important;
}
.home-greeting__profile-btn:hover {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.08);
}
.home-greeting__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ═══════════════════════════════════════════════════════════════════════════
   USER PROFILE MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.up-overlay {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: flex-end;
  background: rgba(0,0,0,0);
  opacity: 0;
  pointer-events: none;
  transition: background 0.3s, opacity 0.3s;
}
.up-overlay--visible {
  opacity: 1;
  background: rgba(0,0,0,0.7);
  pointer-events: all;
}
.up-sheet {
  width: 100%;
  max-height: 92vh;
  background: #1a1f23;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32,0.72,0,1);
  overflow: hidden;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.5);
}
.up-sheet--open { transform: translateY(0); }

/* Handle */
.up-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
  cursor: grab;
}

/* Header */
.up-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.up-header__title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.up-close {
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--color-light--1, #aaa);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.up-close:hover { background: rgba(255,255,255,0.14); }

/* Avatar area */
.up-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 16px;
  flex-shrink: 0;
}
.up-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 3px solid var(--color-brand--2, #00c46a);
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
  box-shadow: 0 0 0 6px rgba(0,196,106,0.1);
}
.up-avatar__img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.up-avatar__input {
  position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0;
}
.up-avatar__btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-light--1, #ccc);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 1.25rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.up-avatar__btn:hover { background: rgba(255,255,255,0.1); }

/* Body */
.up-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 8px;
  -webkit-overflow-scrolling: touch;
}
.up-field { margin-bottom: 20px; }
.up-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1.05rem; font-weight: 700;
  color: var(--color-light--2, #6c7175);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.up-char-count {
  font-size: 1rem; font-weight: 400;
  color: rgba(255,255,255,0.2);
  text-transform: none; letter-spacing: 0;
}
.up-input,
.up-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  color: #fff;
  font-size: 1.45rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
}
.up-input::placeholder, .up-textarea::placeholder { color: rgba(255,255,255,0.2); }
.up-input:focus, .up-textarea:focus { border-color: var(--color-brand--2, #00c46a); }
.up-input--error { border-color: #f87171 !important; }

/* Friend link box */
.up-link-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 11px 14px;
  gap: 10px;
  margin-bottom: 10px;
}
.up-link-url {
  flex: 1;
  font-size: 1.2rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}
.up-link-copy {
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--color-light--1, #ccc);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.up-link-copy:hover { background: rgba(255,255,255,0.14); }

.up-share-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(0,196,106,0.12);
  border: 1.5px solid rgba(0,196,106,0.3);
  color: var(--color-brand--2, #00c46a);
  border-radius: 14px;
  padding: 13px;
  font-size: 1.35rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.up-share-btn:hover { background: rgba(0,196,106,0.2); }

/* Footer */
.up-footer {
  padding: 12px 20px 28px;
  background: #1a1f23;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.up-save-btn {
  width: 100%;
  padding: 16px;
  background: var(--color-brand--2, #00c46a);
  border: none;
  border-radius: 16px;
  color: #fff;
  font-size: 1.5rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
}
.up-save-btn:hover  { opacity: 0.9; }
.up-save-btn:active { transform: scale(0.97); }


/* ═══════════════════════════════════════════════════════════════════════════
   STATS — empty state
   ═══════════════════════════════════════════════════════════════════════════ */

.stats-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 24px;
}
.stats-empty__icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
  opacity: 0.45;
}
.stats-empty__title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-light--1, #aaa);
  margin: 0 0 6px;
}
.stats-empty__sub {
  font-size: 1.25rem;
  color: var(--color-light--2, #6c7175);
  margin: 0 0 18px;
  line-height: 1.5;
}
.stats-empty__btn {
  background: rgba(0,196,106,0.12);
  border: 1.5px solid rgba(0,196,106,0.3);
  color: var(--color-brand--2, #00c46a);
  border-radius: 24px;
  padding: 10px 28px;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.stats-empty__btn:hover { background: rgba(0,196,106,0.22); }


/* ═══════════════════════════════════════════════════════════════════════════
   FAB — Floating Action Button (Home tab)
   ═══════════════════════════════════════════════════════════════════════════ */

#homeFAB {
  position: absolute;
  bottom: 100px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none; /* container is transparent — children opt-in individually */
}

/* Main + button */
.home-fab__btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-brand--2, #00c46a);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,196,106,0.45);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
  flex-shrink: 0;
  pointer-events: all;
}
.home-fab__btn:active { transform: scale(0.92); }
.home-fab__icon {
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.home-fab--open .home-fab__btn {
  transform: rotate(45deg);
  background: rgba(255,255,255,0.15);
}

/* Options menu */
.home-fab__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.home-fab--open .home-fab__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.home-fab__option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--app-bg-card, #242a30);
  border: 1px solid var(--app-border, rgba(255,255,255,0.1));
  border-radius: 24px;
  padding: 10px 16px 10px 12px;
  color: var(--app-text-primary, #fff);
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: background 0.15s, transform 0.15s;
}
.home-fab__option:active { transform: scale(0.96); }
.home-fab__option:hover  { background: var(--app-bg-elevated, #2e363d); }

.home-fab__option-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,196,106,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand--2, #00c46a);
  flex-shrink: 0;
}
.home-fab__option-label {
  color: var(--app-text-primary, #fff);
}

/* Option delay for stagger */
.home-fab__option:nth-child(1) { transition-delay: 0.03s; }
.home-fab__option:nth-child(2) { transition-delay: 0s; }


/* ═══════════════════════════════════════════════════════════════════════════
   POST MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 3300;
  display: flex;
  align-items: flex-end;
  background: rgba(0,0,0,0);
  opacity: 0;
  pointer-events: none;
  transition: background 0.3s, opacity 0.3s;
}
.pm-overlay--visible {
  opacity: 1;
  background: rgba(0,0,0,0.7);
  pointer-events: all;
}
.pm-sheet {
  width: 100%;
  max-height: 92vh;
  background: #1a1f23;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32,0.72,0,1);
  overflow: hidden;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.5);
}
.pm-sheet--open { transform: translateY(0); }
.pm-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0; cursor: grab;
}
.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.pm-header__title {
  font-size: 1.7rem; font-weight: 700; color: #fff; margin: 0;
}
.pm-close {
  background: rgba(255,255,255,0.07);
  border: none; color: #aaa;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.pm-close:hover { background: rgba(255,255,255,0.14); }
.pm-body {
  flex: 1; overflow-y: auto;
  padding: 20px 20px 8px;
  -webkit-overflow-scrolling: touch;
}
.pm-field { margin-bottom: 20px; }
.pm-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1.05rem; font-weight: 700;
  color: var(--color-light--2, #6c7175);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.pm-optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.pm-char-count { font-size: 1rem; font-weight: 400; color: rgba(255,255,255,0.2); text-transform: none; }
.pm-input, .pm-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px; color: #fff;
  font-size: 1.45rem; padding: 13px 16px;
  outline: none; resize: none;
  font-family: inherit; box-sizing: border-box;
  transition: border-color 0.2s;
}
.pm-input::placeholder, .pm-textarea::placeholder { color: rgba(255,255,255,0.2); }
.pm-input:focus, .pm-textarea:focus { border-color: var(--color-brand--2, #00c46a); }
.pm-input--error { border-color: #f87171 !important; }
.pm-photo-zone {
  position: relative; height: 120px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 16px; overflow: hidden;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s, background 0.2s;
}
.pm-photo-zone--filled,
.pm-photo-zone:hover {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.04);
}
.pm-photo-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.pm-photo-placeholder {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  color: rgba(255,255,255,0.25);
  pointer-events: none;
  font-size: 1.2rem;
}
.pm-photo-preview {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pm-photo-remove {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.6); border: none;
  color: #fff; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pm-footer {
  display: flex; gap: 10px;
  padding: 14px 20px 28px;
  background: var(--app-bg-card, #1a1f23);
  border-top: 1px solid var(--app-border, rgba(255,255,255,0.06));
  flex-shrink: 0;
}
.pm-btn {
  flex: 1; padding: 15px;
  border-radius: 16px; border: none;
  font-size: 1.45rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s, transform 0.15s;
}
.pm-btn:active { transform: scale(0.97); }
.pm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pm-btn--cancel {
  background: rgba(255,255,255,0.07);
  color: #aaa; flex: 0 0 auto; padding: 15px 20px;
}
.pm-btn--post {
  background: var(--color-brand--2, #00c46a); color: #fff;
}


/* ═══════════════════════════════════════════════════════════════════════════
   POST CARD extras
   ═══════════════════════════════════════════════════════════════════════════ */

.home-card__avatar--user {
  border-radius: 30% !important;
  overflow: hidden !important;
}
.home-card--post .home-card__avatar--user {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  overflow: hidden;
}
.home-card__avatar-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.home-card__post-badge {
  font-size: 1.05rem; font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
  border: 1px solid rgba(96,165,250,0.3);
}
.home-card__post-title {
  font-size: 1.6rem; font-weight: 700;
  color: #fff; margin: 8px 16px 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   SAVE ACTIVITY MODAL — Activity Stats section (manual only)
   ═══════════════════════════════════════════════════════════════════════════ */

.sam-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px 16px;
}
.sam-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sam-stats-label {
  font-size: 1.3rem;
  color: var(--color-light--1, #aaa);
  flex: 1;
  white-space: nowrap;
}
.sam-stats-input {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 1.3rem;
  padding: 8px 12px;
  outline: none;
  font-family: inherit;
  text-align: right;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.sam-stats-input:focus { border-color: var(--color-brand--2, #00c46a); }
.sam-stats-input--sm { width: 56px; }
.sam-stats-input--md { width: 90px; }

/* Date/time inputs full width on their row */
.sam-stats-row input[type="date"],
.sam-stats-row input[type="time"] {
  text-align: right;
  min-width: 140px;
}

.sam-stats-duration,
.sam-stats-dist {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sam-stats-sep {
  font-size: 1.2rem;
  color: var(--color-light--2, #6c7175);
  white-space: nowrap;
}
.sam-stats-pace {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-light--2, #6c7175);
  transition: color 0.3s;
}


/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICATIONS BELL + PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

/* Greeting actions group */
.home-greeting__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Bell button */
.home-greeting__bell-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  pointer-events: all !important;
}
.home-greeting__bell-btn:hover {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.08);
}

/* Unread badge */
.home-bell__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--color-dark--1, #2d3439);
  line-height: 1;
}

/* ── Notification panel overlay ── */
#homeNotifPanel {
  position: fixed;
  inset: 0;
  z-index: 6000;
  pointer-events: none;
}

.hn-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
  pointer-events: none;
}
.hn-overlay--visible {
  background: rgba(0,0,0,0.65);
  pointer-events: all;
}

.hn-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  max-height: 88vh;
  background: #141417;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.32,0.72,0,1);
  overflow: hidden;
  pointer-events: all;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.5);
}
.hn-sheet--open { transform: translateY(0); }

.hn-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
  cursor: grab;
}

.hn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.hn-header__title {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.hn-clear {
  background: none;
  border: none;
  color: var(--color-brand--2, #00c46a);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
}

.hn-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 32px;
}

/* Empty state */
.hn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
  gap: 12px;
}
.hn-empty span { font-size: 3rem; opacity: 0.4; }
.hn-empty p {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.3);
  margin: 0;
}

/* Notification item */
.hn-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
  cursor: default;
}
.hn-item--unread {
  background: rgba(0,196,106,0.04);
  border-left: 3px solid var(--color-brand--2, #00c46a);
  padding-left: 17px;
}
.hn-item:active { background: rgba(255,255,255,0.04); }

.hn-item__icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.hn-item__body { flex: 1; min-width: 0; }
.hn-item__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1.3;
}
.hn-item__body-text {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
  margin-bottom: 4px;
}
.hn-item__time {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.3);
}

@media (min-width: 900px) {
  .hn-sheet { max-width: 440px; left: auto; right: 16px; border-radius: 20px 20px 0 0; }
}


/* ── SaveActivityModal — interactive map hint ── */
.sam-map-preview {
  position: relative;
}
.sam-map-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

/* sam-char-count reuses pm-char-count style */
.sam-char-count { font-size: 1rem; font-weight: 400; color: rgba(255,255,255,0.2); text-transform: none; letter-spacing: 0; margin-left: auto; }


/* ── Post card — menu, read-more ── */
.home-card__post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.home-card__post-menu-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.home-card__post-menu-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.home-card__post-menu {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 100;
  background: #242a30;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.92) translateY(-6px);
  transform-origin: top right;
  transition: opacity 0.18s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  min-width: 140px;
}
.home-card__post-menu--open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
.home-card__post-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--color-light--1, #ccc);
  font-size: 1.3rem;
  font-family: inherit;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.home-card__post-menu-item:hover { background: rgba(255,255,255,0.07); }
.home-card__post-menu-item--del { color: #f87171; }
.home-card__post-menu-item--del:hover { background: rgba(248,113,113,0.1); }

/* Read more button */
.home-card__read-more {
  background: none;
  border: none;
  color: var(--color-brand--2, #00c46a);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 16px 10px;
  font-family: inherit;
  display: block;
}


/* ═══════════════════════════════════════════════════════════════════════════
   STREAK WIDGET
   ═══════════════════════════════════════════════════════════════════════════ */

.home-streak {
  margin: 10px 16px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 14px 16px;
  overflow: hidden;
}

.home-streak__inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Flame + count */
.home-streak__flame-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.home-streak__flame {
  width: 32px;
  height: 40px;
  filter: drop-shadow(0 0 8px rgba(249,115,22,0.6));
}
.home-streak__count {
  font-size: 1.5rem;
  font-weight: 900;
  color: #f97316;
  line-height: 1;
}

/* Right side */
.home-streak__right {
  flex: 1;
  min-width: 0;
}
.home-streak__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 7 day dots */
.home-streak__dots {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.home-streak__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.home-streak__dot {
  width: 100%;
  max-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.1);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.home-streak__dot--active {
  background: #f97316;
  border-color: #f97316;
  box-shadow: 0 0 8px rgba(249,115,22,0.5);
}
.home-streak__dot--today {
  border-color: rgba(255,255,255,0.4);
}
.home-streak__dot--active.home-streak__dot--today {
  border-color: #fff;
  transform: scale(1.1);
}

.home-streak__day-label {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.home-streak__day-label--today {
  color: rgba(255,255,255,0.7);
  font-weight: 700;
}


/* ── Search button in greeting ── */
.home-greeting__search-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.home-greeting__search-btn:hover {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.08);
}


/* ── Share to club (SaveActivityModal + PostModal) ── */
.sam-share-clubs,
.pm-share-clubs {
  padding: 0 20px 8px;
}
.sam-share-clubs__inner {
  background: var(--app-surface-1, rgba(255,255,255,0.04));
  border: 1px solid var(--app-border, rgba(255,255,255,0.08));
  border-radius: 16px;
  padding: 14px 16px;
}
.sam-share-clubs__title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--app-text-tertiary, rgba(255,255,255,0.4));
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 10px;
}
.sam-share-clubs__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--app-border, rgba(255,255,255,0.05));
}
.sam-share-clubs__item:last-child { border-bottom: none; }
.sam-share-clubs__item input[type="checkbox"] { display: none; }
.sam-share-clubs__check-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--app-border, rgba(255,255,255,0.2));
  background: var(--app-surface-1, rgba(255,255,255,0.04));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.sam-share-clubs__item input:checked + .sam-share-clubs__check-icon {
  background: var(--color-brand--2, #00c46a);
  border-color: var(--color-brand--2, #00c46a);
}
.sam-share-clubs__item input:checked + .sam-share-clubs__check-icon::after {
  content: '✓';
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}
.sam-share-clubs__name {
  font-size: 1.3rem; font-weight: 600; color: var(--app-text-primary, #fff);
}


/* ═══════════════════════════════════════════════════════════════════════════
   REELS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.home-reels-bar {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.home-reels-bar::-webkit-scrollbar { display: none; }

/* Reels bar inside header dark section */
.home-reels-bar--in-header {
  background: var(--color-dark--1, #2d3439);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-top: 0;
}

.home-reel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Avatar ring */
.home-reel-avatar {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  box-sizing: border-box;
  background: rgba(255,255,255,0.08); /* no ring by default */
}
.home-reel-avatar--active {
  background: conic-gradient(#00c46a 0deg 360deg);
}
.home-reel-avatar--seen {
  background: conic-gradient(rgba(255,255,255,0.25) 0deg 360deg);
}
.home-reel-avatar--sm {
  width: 32px; height: 32px;
  padding: 2px;
}

.home-reel-avatar__inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid #141417;
  overflow: hidden;
  background: #2a2a30;
}
.home-reel-avatar__img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  display: block;
  border: 2px solid #141417;
}
.home-reel-avatar__placeholder {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid #141417;
  background: #333;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}

.home-reel-add-btn {
  position: absolute;
  bottom: 0; right: 0;
  width: 18px; height: 18px;
  background: #00c46a;
  border-radius: 50%;
  border: 2px solid #141417;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.home-reel-name {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Streak compact — smaller dots */
.home-streak { max-height: 80px; }
.home-streak__dots { gap: 3px !important; }
.home-streak__day { width: 22px !important; height: 22px !important; font-size: 8px !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   REEL CREATOR
   ═══════════════════════════════════════════════════════════════════════════ */

.home-reel-creator {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.32,0.72,0,1);
}
.home-reel-creator--visible {
  opacity: 1;
  transform: translateY(0);
}

.home-reel-creator__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Pasek statusu (edge-to-edge) zaslanial „X" i tytul „New Reel". */
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  background: rgba(0,0,0,0.6);
  flex-shrink: 0;
  z-index: 2;
}
.home-reel-creator__close {
  background: rgba(255,255,255,0.15);
  border: none; color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%; font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.home-reel-creator__title {
  font-size: 15px; font-weight: 700; color: #fff;
}
.home-reel-creator__share {
  background: #00c46a;
  border: none; color: #fff;
  border-radius: 20px; padding: 7px 16px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: opacity 0.2s;
}
.home-reel-creator__share:disabled { opacity: 0.4; cursor: default; }

.home-reel-creator__stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000; padding: 6px;
}
.home-reel-creator__canvas {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 100%; aspect-ratio: 9 / 16; max-width: 100%; width: auto;
  margin: 0 auto;
  overflow: hidden;
  background: #111;
}
.home-reel-creator__pick {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.4); cursor: pointer; font-size: 14px;
}
.home-reel-creator__preview {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
.home-reel-creator__caption-overlay {
  position: absolute; inset: 0; pointer-events: none;
}
.home-reel-creator__caption-text {
  position: absolute;
  white-space: pre-wrap;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  cursor: move;
  user-select: none;
}

.home-reel-creator__right-tools {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  z-index: 5;
}
.home-reel-creator__tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
  justify-content: center;
}
.home-reel-creator__tool-lbl {
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
  position: absolute;
  bottom: -14px;
  white-space: nowrap;
}
.home-reel-creator__tool-btn { position: relative; }
.home-reel-creator__color-wheel {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.home-reel-creator__caption {
  position: absolute;
  bottom: 70px;
  left: 14px; right: 60px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px; color: #fff;
  font-size: 15px; padding: 8px 12px;
  outline: none; font-family: inherit;
  z-index: 6;
}
.home-reel-creator__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.6);
  flex-shrink: 0;
}
.home-reel-creator__hint {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* Color palette popup */
.home-reel-creator__palette {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0,0,0,0.75);
  border-radius: 12px;
  padding: 10px 8px;
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.15);
}
.home-reel-creator__color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  cursor: pointer;
  transition: transform 0.15s;
}
.home-reel-creator__color-swatch:active { transform: scale(1.2); }

/* Size slider popup */
.home-reel-creator__size-slider-wrap {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.75);
  border-radius: 12px;
  padding: 12px 10px;
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.15);
  min-width: 44px;
}
.home-reel-creator__size-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 120px;
  cursor: pointer;
  accent-color: #00c46a;
}
.home-reel-creator__size-val {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REEL VIEWER
   ═══════════════════════════════════════════════════════════════════════════ */

.home-reel-viewer {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.home-reel-viewer--visible { opacity: 1; }

.home-reel-viewer__bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.home-reel-viewer__media {
  width: 100%; height: 100%; object-fit: contain;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.home-reel-viewer__media[src$=".mp4"],
.home-reel-viewer__media[src*="video"],
video.home-reel-viewer__media {
  object-fit: cover;
}
.home-reel-viewer__caption {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  white-space: pre-wrap;
  text-align: center;
  pointer-events: none;
}

.home-reel-viewer__top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 12px 12px 8px;
  z-index: 2;
}
.home-reel-viewer__bars {
  display: flex; gap: 3px; margin-bottom: 10px;
}
.home-reel-viewer__bar {
  flex: 1; height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px; overflow: hidden;
  position: relative;
}
.home-reel-viewer__bar.done { background: #fff; }
.home-reel-viewer__bar.active::after {
  content: '';
  position: absolute; inset: 0;
  background: #fff;
  width: var(--p, 0%);
  transition: width 50ms linear;
}

.home-reel-viewer__author {
  display: flex; align-items: center; gap: 8px;
}
.home-reel-viewer__name {
  font-size: 13px; font-weight: 700; color: #fff;
}
.home-reel-viewer__time {
  font-size: 11px; color: rgba(255,255,255,0.5);
}
.home-reel-viewer__close {
  /* Odtwarzacz jest pelnoekranowy, wiec przycisk wyjscia wpadal pod pasek
     statusu i nie dalo sie zamknac ogladanego reelsa. */
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px;
  background: rgba(0,0,0,0.4);
  border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.home-reel-viewer__actions {
  position: absolute;
  bottom: 32px; right: 16px;
  display: flex; flex-direction: column; gap: 16px;
  z-index: 2;
}
.home-reel-viewer__like {
  background: none; border: none; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; font-size: 11px; cursor: pointer;
}
.home-reel-viewer__like.liked { color: #ff3b30; }
.home-reel-viewer__delete {
  background: none; border: none; font-size: 20px; cursor: pointer;
}

/* Tap zones */
.home-reel-viewer__tap-left,
.home-reel-viewer__tap-right {
  position: absolute;
  top: 60px; bottom: 80px;
  width: 30%;
  z-index: 3;
}
.home-reel-viewer__tap-left  { left: 0; }
.home-reel-viewer__tap-right { right: 0; }

/* Ring on feed card avatars */
.home-card__avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.home-card__avatar-wrap--reel {
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(#00c46a 0deg 360deg);
}
.home-card__avatar-wrap--reel-seen {
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(rgba(255,255,255,0.25) 0deg 360deg);
}

/* ═══ iOS SAFE AREA — nagłówek Home poniżej zegara/wyspy ═══ */
.home-greeting {
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

/* ═══ SHARE STUDIO ═══════════════════════════════════════════════════════════ */
.ss-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.26s;
}
.ss-overlay--visible { opacity: 1; pointer-events: all; }
.ss-sheet {
  width: 100%; max-width: 560px; max-height: 94dvh;
  background: var(--app-bg-card, #fff); border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ss-overlay--visible .ss-sheet { transform: translateY(0); }
.ss-sheet--compact { max-height: 50dvh; }

.ss-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 12px;
  flex-shrink: 0;
}
.ss-close { background: none; border: none; font-family: inherit; font-size: 1.5rem; color: var(--app-text-secondary, #666); cursor: pointer; }
.ss-title { font-size: 1.7rem; font-weight: 800; color: var(--app-text-primary, #111); }

/* Swipe stage */
.ss-stage { overflow: hidden; padding: 4px 0 12px; height: 52vh; max-height: 460px; }
.ss-track { display: flex; height: 100%; transition: transform 0.32s cubic-bezier(0.32,0.72,0,1); will-change: transform; }
.ss-slide { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; padding: 0 40px; }
.ss-canvas {
  height: 100%; width: auto; max-width: calc(100% - 80px);
  aspect-ratio: 1080 / 1920;
  border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  background: #12171b;
}

.ss-dots { display: flex; justify-content: center; gap: 7px; padding: 4px 0 14px; }
.ss-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--app-border, #ccc); transition: all 0.2s; }
.ss-dot--on { background: var(--color-brand--2, #00c46a); width: 22px; border-radius: 4px; }

/* Stat chips */
.ss-stats { padding: 0 20px 4px; }
.ss-stats__title { font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--app-text-muted, #888); margin-bottom: 8px; }
.ss-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-chip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--app-surface-1, #f0f0f0); border: 1.5px solid transparent;
  font-family: inherit; font-size: 1.25rem; font-weight: 600;
  color: var(--app-text-secondary, #555); transition: all 0.15s;
}
.ss-chip--on {
  background: rgba(0,196,106,0.12); border-color: var(--color-brand--2, #00c46a);
  color: var(--color-brand--2, #00c46a);
}

/* Actions */
.ss-actions { display: flex; gap: 10px; padding: 16px 20px 20px; }
.ss-actions--wide { padding: 20px; }
.ss-act {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 16px; cursor: pointer;
  background: var(--app-surface-1, #f5f5f5); border: none;
  font-family: inherit; font-size: 1.2rem; font-weight: 700;
  color: var(--app-text-primary, #111);
}
.ss-act:active { background: var(--app-surface-2, #e8e8e8); }
/* Ikony akcji — SVG, spójna kreska, kolor brandu (zamiast tanich emoji) */
.ss-act__ic { width: 26px; height: 26px; color: var(--color-brand--2, #00c46a); }
.ss-actions--wide .ss-act { flex-direction: row; gap: 10px; padding: 16px; font-size: 1.4rem; }

/* Podgląd szablonu przezroczystego — szachownica pod canvasem sygnalizuje
   brak tła (dokładnie jak w Stravie). Do PNG NIE trafia — to tylko podgląd. */
.ss-canvas--transparent {
  background-image:
    linear-gradient(45deg, #c8ccd0 25%, transparent 25%),
    linear-gradient(-45deg, #c8ccd0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c8ccd0 75%),
    linear-gradient(-45deg, transparent 75%, #c8ccd0 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  background-color: #e9ebee;
}
.ss-slide { position: relative; }
.ss-transparent-tag {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  font-size: 1.05rem; font-weight: 800; letter-spacing: 1px;
  color: #fff; background: rgba(0,0,0,0.55);
  padding: 5px 12px; border-radius: 8px; pointer-events: none;
}
