/* Community Sightings — bottom sheet + FAB + modal styles.
 * Keep colors aligned with STM dashboard (dark first, light theme overrides
 * at bottom). */

.ld-community-sheet {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.ld-community-sheet-visible {
  pointer-events: auto;
  opacity: 1;
}
.ld-community-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.ld-community-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: env(safe-area-inset-bottom, 0px);
  transform: translate(-50%, 100%);
  width: min(480px, calc(100vw - 16px));
  max-height: 78vh;
  overflow: auto;
  background: #0e1728;
  color: #e6edf7;
  border-radius: 18px 18px 8px 8px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  transition: transform 220ms cubic-bezier(0.3, 0, 0.2, 1);
  padding-bottom: 10px;
}
.ld-community-sheet-visible .ld-community-sheet-panel {
  transform: translate(-50%, 0);
}
.ld-community-sheet-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.ld-community-sheet-photo-wrap {
  position: relative;
}
.ld-community-sheet-photo {
  display: block;
  width: 100%;
  max-height: 45vh;
  object-fit: cover;
  background: #000;
  border-radius: 18px 18px 0 0;
}
.ld-community-sheet-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 18px 18px 0 0;
}
.ld-community-sheet-overlay polygon,
.ld-community-sheet-overlay polyline {
  fill: rgba(255, 200, 60, 0.18);
  stroke: #ffcc33;
  stroke-width: 0.7;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.8));
  vector-effect: non-scaling-stroke;
}
.ld-community-sheet-overlay polyline {
  fill: none;
}
.ld-community-sheet-kind {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(10, 18, 32, 0.82);
  color: #e6edf7;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.ld-community-sheet-kind[data-kind="launch"]    { border: 1px solid #1d64ff; }
.ld-community-sheet-kind[data-kind="reentry"]   { border: 1px solid #ff8c42; }
.ld-community-sheet-kind[data-kind="satellite"] { border: 1px solid #8fd6a5; }
.ld-community-sheet-fuzz {
  color: #8fb6ff;
  font-size: 12px;
  background: rgba(143, 182, 255, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}
.ld-community-sheet-notes {
  font-size: 13px;
  line-height: 1.45;
  margin: 2px 0 10px;
  color: #c5cfdd;
  white-space: pre-wrap;
}
.ld-community-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ld-community-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #dce5f1;
}
.ld-community-sheet-body {
  padding: 12px 16px 6px;
}
.ld-community-sheet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #aab5c4;
  margin-bottom: 6px;
}
.ld-community-sheet-handle {
  color: #e6edf7;
  font-weight: 600;
}
.ld-community-sheet-dist {
  color: #8fb6ff;
}
.ld-community-sheet-caption {
  font-size: 15px;
  line-height: 1.35;
  margin: 6px 0 12px;
  color: #dce5f1;
}
.ld-community-sheet-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 6px;
}
.ld-community-act {
  flex: 1;
  padding: 10px 8px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.07);
  color: #e6edf7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}
.ld-community-act:hover,
.ld-community-act:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

/* Submit sheet (mobile native-bridge opens this) */
.ld-community-submit-sheet {
  position: fixed;
  inset: 0;
  z-index: 12500;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 180ms ease;
}
.ld-community-submit-sheet.visible {
  opacity: 1;
}
.ld-community-submit-panel {
  background: #0e1728;
  color: #e6edf7;
  width: min(480px, 100%);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform 200ms ease;
  max-height: 92vh;
  overflow: auto;
}
.ld-community-submit-sheet.visible .ld-community-submit-panel {
  transform: translateY(0);
}
.ld-community-submit-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}
.ld-community-submit-subtitle {
  font-size: 13px;
  color: #98a4b6;
  margin: 0 0 14px;
}
.ld-community-photo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  touch-action: none;
}
.ld-community-photo-stage.drawing {
  cursor: crosshair;
}
.ld-community-submit-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.ld-community-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 12px;
}
.ld-community-bbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ld-community-chip-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #e6edf7;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  min-height: 34px;
  cursor: pointer;
}
.ld-community-chip-btn.on {
  background: rgba(255, 204, 51, 0.22);
  border-color: #ffcc33;
  color: #ffcc33;
}
.ld-community-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #c5cfdd;
}
.ld-community-kind-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
  border: 1px solid;
}
.ld-community-kind-chip[data-kind="launch"]    { color: #6aa0ff; border-color: #1d64ff; }
.ld-community-kind-chip[data-kind="reentry"]   { color: #ff8c42; border-color: #ff8c42; }
.ld-community-kind-chip[data-kind="satellite"] { color: #8fd6a5; border-color: #8fd6a5; }

/* Observations group */
.ld-community-details {
  margin: 4px 0 10px;
}
.ld-community-details summary {
  cursor: pointer;
  font-size: 13px;
  color: #8fb6ff;
  padding: 8px 0;
}
.ld-community-submit-notes {
  width: 100%;
  min-height: 80px;
  max-height: 160px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #e6edf7;
  padding: 10px 12px;
  font-size: 13px;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  margin-top: 4px;
}
.ld-community-obs-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.ld-community-obs-check,
.ld-community-obs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #c5cfdd;
}
.ld-community-obs-row select,
.ld-community-obs-row input[type="number"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e6edf7;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  flex: 1;
  min-width: 80px;
}

/* Location-mode sheet */
.ld-community-locmode-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 14px;
}
.ld-community-locmode-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
}
.ld-community-locmode-card:has(input:checked) {
  background: rgba(29, 100, 255, 0.12);
  border-color: #1d64ff;
}
.ld-community-locmode-card input[type="radio"] {
  margin-top: 2px;
  accent-color: #1d64ff;
}
.ld-community-locmode-card > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.ld-community-locmode-card strong {
  color: #fff;
  font-size: 14px;
}
.ld-community-locmode-card span {
  color: #98a4b6;
  font-size: 12px;
}
.ld-community-locmode-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10px !important;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #10B981 !important;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 999px;
  vertical-align: 2px;
}
.ld-community-fuzz-row {
  display: flex !important;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: #c5cfdd;
}
.ld-community-fuzz-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 10px;
}
.ld-community-map-picker {
  margin-bottom: 12px;
}
.ld-community-map-note {
  font-size: 12px;
  color: #98a4b6;
  margin-bottom: 6px;
}
.ld-community-map-value {
  font-size: 12px;
  color: #8fd6a5;
  margin-top: 6px;
}

/* Upgrade-gate sheet (shown when a Free user taps the community FAB) */
.ld-community-upgrade-sheet .ld-community-submit-panel {
  max-width: 440px;
}
.ld-community-upgrade-hero {
  text-align: center;
  padding: 4px 0 8px;
}
.ld-community-upgrade-glyph {
  display: block;
  font-size: 48px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 16px rgba(29, 100, 255, 0.5));
}
.ld-community-upgrade-bullets {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ld-community-upgrade-bullets li {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #dce5f1;
}
body.theme-light .ld-community-upgrade-bullets li {
  background: rgba(0, 0, 0, 0.04);
  color: #1f2735;
  border-color: rgba(0, 0, 0, 0.1);
}

/* Globe pin picker overlay */
#ld-community-globe-picker {
  position: fixed;
  inset: 0;
  z-index: 12800;
  pointer-events: none;
}
#ld-community-globe-picker .ld-community-picker-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 38px;
  color: #ffcc33;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
#ld-community-globe-picker .ld-community-picker-bar {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(10, 16, 28, 0.94);
  color: #e6edf7;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(74, 158, 255, 0.4);
  font-size: 13px;
  max-width: min(480px, calc(100vw - 16px));
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
#ld-community-globe-picker .ld-community-picker-bar button {
  padding: 8px 12px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #e6edf7;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#ld-community-globe-picker .ld-community-picker-bar button.primary {
  background: linear-gradient(180deg, #1d64ff, #0a48cc);
  border-color: transparent;
  color: #fff;
}
.ld-community-submit-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #98a4b6;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}
.ld-community-submit-placeholder > span {
  display: inline-block;
  white-space: normal;
  word-spacing: normal;
}
.ld-community-submit-placeholder strong {
  margin: 0 2px;
}
.ld-community-submit-caption {
  width: 100%;
  min-height: 64px;
  max-height: 120px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #e6edf7;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
}
.ld-community-submit-counter {
  text-align: right;
  font-size: 12px;
  color: #8b96a7;
  margin-top: 4px;
}
.ld-community-submit-geo {
  font-size: 12px;
  color: #98a4b6;
  margin: 10px 0;
}
.ld-community-submit-geo-ok {
  color: #8fd6a5;
}
.ld-community-submit-geo-err {
  color: #f4a7a7;
}
.ld-community-submit-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.ld-community-submit-btn {
  flex: 1;
  padding: 12px 12px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #e6edf7;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ld-community-submit-btn-primary {
  background: linear-gradient(180deg, #1d64ff, #0a48cc);
  border-color: transparent;
}
.ld-community-submit-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* First-use consent modal */
.ld-community-consent-sheet .ld-community-submit-panel {
  max-width: 420px;
}
.ld-community-consent-body {
  font-size: 14px;
  line-height: 1.45;
  color: #d4dde9;
}
.ld-community-consent-body strong {
  color: #fff;
}
.ld-community-consent-list {
  margin: 12px 0;
  padding-left: 20px;
}
.ld-community-consent-list li {
  margin-bottom: 8px;
}
.ld-community-consent-h3 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 14px 0 4px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ld-community-consent-h3:first-child {
  margin-top: 4px;
}
body.theme-light .ld-community-consent-h3 {
  color: #0e1728;
}

/* My Sightings list */
.ld-community-my {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
}
.ld-community-my-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}
.ld-community-my-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #000;
}
.ld-community-my-meta {
  padding: 8px;
  font-size: 12px;
  color: #cbd3dd;
}
.ld-community-my-state {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ld-community-my-state[data-state="live"] { background: rgba(0, 180, 90, 0.2); color: #7ee0a0; }
.ld-community-my-state[data-state="hidden"] { background: rgba(255, 170, 40, 0.2); color: #ffc97a; }
.ld-community-my-state[data-state="removed"] { background: rgba(220, 60, 80, 0.2); color: #f09ea6; }
.ld-community-my-strikes {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(255, 170, 40, 0.08);
  border-left: 3px solid rgba(255, 170, 40, 0.5);
  font-size: 13px;
  color: #ffc97a;
}

/* Light mode — inherits STM theme-light rules */
body.theme-light .ld-community-sheet-panel,
body.theme-light .ld-community-submit-panel {
  background: #ffffff;
  color: #0e1728;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
}
body.theme-light .ld-community-sheet-caption,
body.theme-light .ld-community-submit-title,
body.theme-light .ld-community-submit-subtitle {
  color: #2b3648;
}
body.theme-light .ld-community-act {
  color: #1f2735;
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}
body.theme-light .ld-community-sheet-close {
  background: rgba(0, 0, 0, 0.08);
  color: #0e1728;
}
body.theme-light .ld-community-submit-caption {
  background: rgba(0, 0, 0, 0.04);
  color: #1f2735;
  border-color: rgba(0, 0, 0, 0.12);
}
body.theme-light .ld-community-submit-btn {
  color: #1f2735;
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}
body.theme-light .ld-community-submit-btn-primary {
  color: #ffffff;
}
