/* Spotted page
   Loaded after style.css. This file owns the complete Spotted feature UI. */
/* ============================================
   SPOTTED PUBLIC LINK (NGL-LIKE)
   ============================================
*/

/* Colori spot presi dall'app e dal design di Fabione pisellone */
:root {
  --spot-rose: #F6D6DE;
  --spot-violet: #BDC5FF;
  --spot-peach: #F6D8C2;
  --spot-mint: #CDEFD8;
  --spot-pink: #EFCFE8;
  --spot-lime: #ECEFC0;
  --spot-sky: #CFE6FF;

  --border-spot-rose: #ECB8C5;
  --border-spot-violet: #A5B0FF;
  --border-spot-peach: #EDC2A3;
  --border-spot-mint: #9FDEB2;
  --border-spot-pink: #E3B2D7;
  --border-spot-lime: #DFE39A;
  --border-spot-sky: #A8D0FF;

  --pubblica-button-spot: #F63363;
  --spot-like: #ef4444;
  --spot-like-bg: #fef2f2;
  --spot-like-bg-strong: #fee2e2;
  --spot-comment-line: #f1f5f9;
  --spot-card-ink: #141824;
  --spot-card-action: #435070;
  --spot-card-action-hover: #202a48;
  --spot-card-muted: #4e566c;
  --spot-card-time: #626b82;
  --spot-dialog-shadow: rgba(23, 27, 49, 0.28);
  --spot-dialog-backdrop: rgba(16, 20, 36, 0.54);
}

.spotted-public-link-row {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.spotted-public-link-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 10px var(--space-2);
  font-size: 0.85rem;
  color: var(--text-main);
  background: var(--neutral-surface-alt);
}

.spotted-public-link-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spotted-public-link-status {
  font-size: 0.82rem;
  color: var(--subtext);
}

.spotted-public-link-status.is-error {
  color: var(--danger-main);
}

/* ============================================
   SPOTTED IG CARDS
   ============================================ */
.spotted-user-search-card {
  padding: 14px;
}

.spotted-user-search-box {
  margin-top: 10px;
}

.spotted-user-search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-2);
  font-size: 0.86rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spotted-user-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

.spotted-user-search-status {
  margin: var(--space-1) 2px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spotted-user-search-status.is-loading {
  color: var(--primary);
}

.spotted-user-search-status.is-error {
  color: var(--error);
}

.spotted-user-search-results {
  margin-top: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.spotted-user-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.spotted-user-search-item:hover,
.spotted-user-search-item:focus {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: var(--primary-light);
  transform: translateY(-1px);
  outline: none;
}

.spotted-user-search-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--brand-deep));
}

.spotted-user-search-item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.spotted-user-search-item-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotted-user-search-item-meta {
  margin: 0;
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotted-mention-suggestions {
  margin-top: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.spotted-mention-suggestion {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px var(--space-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.spotted-mention-suggestion:hover,
.spotted-mention-suggestion:focus {
  background: var(--neutral-surface-alt);
  outline: none;
}

.spotted-mention-suggestion-nick {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotted-mention-suggestion-name {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotted-mention {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.spotted-mention:hover {
  text-decoration: underline;
}

/* Like & Comment buttons */
.btn-like {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.btn-like:active {
  transform: scale(0.92);
}

.btn-like.liked {
  background: linear-gradient(135deg, var(--spot-like-bg) 0%, var(--spot-like-bg-strong) 100%);
  border-color: var(--spot-like);
  color: var(--spot-like);
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.btn-like.liked .like-count {
  animation: heartPop 0.3s ease;
}

.btn-comment {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.btn-comment:active {
  transform: scale(0.92);
}

.comment-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ============================================
   COMMENTS
   ============================================ */
.comments-list {
  margin-bottom: 10px;
}

.comment {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--spot-comment-line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-1);
}

.comment:last-child {
  border-bottom: none;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: var(--space-1);
}

.comment-text {
  font-size: 0.88rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-delete-comment {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  line-height: 1;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.comment-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.comment-input {
  flex: 1;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
  min-height: 40px;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary);
}

.comment-mention-suggestions {
  margin-top: 0;
  position: relative;
  z-index: 260;
}

/* Current social card-deck layout. */
.spotted-compose-section {
  border-bottom: 1px solid var(--border);
}

.spotted-feed+.spotted-compose-section {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.spotted-page .spotted-compose-input-wrap textarea {
  min-height: 104px;
  padding: 15px var(--space-3) 30px;
  line-height: 1.5;
}

.spotted-page .spotted-compose-count {
  bottom: 9px;
  right: 14px;
  font-variant-numeric: tabular-nums;
}

.spotted-color-field {
  min-width: 0;
  margin: 15px 0 0;
  padding: 0;
  border: 0;
}

.spotted-color-field legend {
  margin-bottom: var(--space-1);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
}

.spotted-color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spotted-color-option {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.spotted-color-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.spotted-color-option span {
  width: 34px;
  height: 34px;
  border: 2px solid var(--spotted-card-border);
  border-radius: 50%;
  background: var(--spotted-card-background);
  box-shadow: 0 0 0 2px transparent;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.spotted-color-option:hover span {
  transform: scale(1.08);
}

.spotted-color-option input:checked+span {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}

.spotted-color-option input:focus-visible+span {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.spotted-page .spotted-compose-input-wrap[data-spotted-color] textarea {
  border-color: var(--spotted-card-border);
  background: var(--spotted-card-background);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.spotted-compose-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: var(--space-3) 2px 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.spotted-compose-meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

#spotted-destination-field {
  margin: var(--space-3) 0 0;
  padding: 15px 0 0;
  border-top: 1px solid var(--border);
}

.spotted-destination-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 10px;
}

.spotted-field-label {
  display: block;
  margin: 0;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
}

.spotted-destination-heading small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.spotted-destination-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.spotted-target-select-wrap {
  min-width: 0;
  margin: 0;
}

.spotted-page .spotted-target-select-wrap select {
  min-height: 46px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
}

.spotted-page .spotted-target-select-wrap select:disabled {
  opacity: 1;
  cursor: default;
  -webkit-text-fill-color: var(--text-secondary);
}

.spotted-target-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotted-page .spotted-target-help {
  margin: var(--space-2) 2px 0;
  line-height: 1.35;
}

.spotted-page .compose-submit-btn {
  min-width: 140px;
  min-height: 44px;
  margin-top: 15px;
  border-color: var(--pubblica-button-spot);
  border-radius: var(--btn-radius);
  background: var(--pubblica-button-spot);
  padding-inline: var(--space-4);
}

.spotted-page .compose-submit-btn:hover {
  border-color: color-mix(in srgb, var(--pubblica-button-spot) 84%, var(--color-black) 16%);
  background: color-mix(in srgb, var(--pubblica-button-spot) 84%, var(--color-black) 16%);
}

.spotted-tools {
  border-bottom: 1px solid var(--border);
}

.spotted-tool+.spotted-tool {
  border-top: 1px solid var(--border);
}

.spotted-tool,
.spotted-page .spotted-user-search-card {
  padding: 0;
  background: transparent;
}

.spotted-tool summary {
  position: relative;
  display: flex;
  padding: 15px 36px 15px 0;
  cursor: pointer;
  list-style: none;
}

.spotted-tool summary::-webkit-details-marker {
  display: none;
}

.spotted-tool summary::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.spotted-tool[open] summary::after {
  transform: rotate(225deg);
}

.spotted-tool summary>span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spotted-tool summary strong {
  color: var(--text-main);
  font-size: 0.88rem;
}

.spotted-tool summary small,
.spotted-tool-copy {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.spotted-tool-body {
  padding: 0 0 18px;
}

.spotted-tool-copy {
  margin: 0 0 10px;
}

.spotted-page .spotted-user-search-box {
  margin-top: 0;
}

.spotted-page .spotted-user-search-input,
.spotted-page .spotted-public-link-row input {
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.spotted-page .spotted-user-search-results {
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

.spotted-page .spotted-user-search-item {
  gap: var(--space-2);
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  transform: none;
}

.spotted-page .spotted-user-search-item:hover,
.spotted-page .spotted-user-search-item:focus {
  background: transparent;
  transform: none;
}

.spotted-page .spotted-user-search-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.spotted-page .spotted-user-search-avatar {
  background: var(--surface-strong);
  color: var(--primary);
  border: 1px solid var(--border);
}

.spotted-page .spotted-public-link-actions {
  margin-top: 10px;
}

.spotted-page .spotted-public-link-status {
  display: block;
  min-height: 18px;
  margin-top: var(--space-1);
}

.spotted-feed {
  padding-top: 22px;
}

.spotted-feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: 10px;
}

.spotted-feed-header h2 {
  margin: 0;
  font-size: 1.12rem;
}

.spotted-feed-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.spotted-deck-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.spotted-deck-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.spotted-deck-controls button:hover {
  background: var(--surface-strong);
  color: var(--text-main);
  transform: translateY(-1px);
}

.spotted-deck-controls button:active {
  transform: scale(0.9);
}

.spotted-deck-controls output {
  min-width: 42px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
}

.spotted-page #spotted-list,
.spotted-page #no-spotted {
  width: 100%;
  max-width: none;
}

.spotted-page #spotted-list {
  position: relative;
  min-height: 300px;
  padding: var(--space-1) 0 28px;
  overflow: visible;
  transition: height 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.spotted-page .spotted-ig-card {
  position: absolute;
  top: 8px;
  left: 50%;
  width: min(430px, calc(100% - 40px));
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(-50% + var(--deck-drag-x, 0px))) translateY(var(--deck-y, 0px)) rotate(var(--deck-drag-rotate, 0deg)) scale(var(--deck-scale, 1));
  transform-origin: top center;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 250ms ease;
}

.spotted-page .spotted-ig-card:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: translateX(calc(-50% + var(--deck-drag-x, 0px))) translateY(var(--deck-y, 0px)) rotate(var(--deck-drag-rotate, 0deg)) scale(var(--deck-scale, 1));
}

.spotted-page .spotted-ig-card.is-deck-visible {
  visibility: visible;
  opacity: var(--deck-drag-opacity, var(--deck-opacity, 1));
  will-change: transform, opacity;
}

.spotted-page .spotted-ig-card.is-deck-active {
  pointer-events: auto;
}

.spotted-page .spotted-ig-card.is-deck-dragging {
  cursor: grabbing;
  transition: none;
}

.spotted-page .spotted-ig-card.is-deck-returning {
  transition: transform 420ms cubic-bezier(0.22, 1.24, 0.36, 1), opacity 250ms ease;
}

.spotted-page .spotted-ig-card.is-deck-promoting {
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease-out;
}

.spotted-page .spotted-ig-card.is-deck-resetting {
  transition: none;
}

.spotted-page .spotted-ig-card.is-swiping-out-left {
  opacity: 0;
  transform: translateX(calc(-50% - 110vw)) rotate(-12deg);
  transition: transform 360ms cubic-bezier(0.32, 0, 0.18, 1), opacity 230ms ease-out;
}

.spotted-page .spotted-ig-card.is-swiping-out-right {
  opacity: 0;
  transform: translateX(calc(-50% + 110vw)) rotate(12deg);
  transition: transform 360ms cubic-bezier(0.32, 0, 0.18, 1), opacity 230ms ease-out;
}

.spotted-message-card {
  --spotted-card-border: var(--border-spot-violet);
  --spotted-card-background: var(--spot-violet);
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: center;
  border: 2px solid var(--spotted-card-border);
  border-radius: 18px;
  padding: 76px var(--space-5) 64px;
  background: var(--spotted-card-background);
  color: var(--spot-card-ink);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

[data-spotted-color="rose"] {
  --spotted-card-border: var(--border-spot-rose);
  --spotted-card-background: var(--spot-rose);
}

[data-spotted-color="violet"] {
  --spotted-card-border: var(--border-spot-violet);
  --spotted-card-background: var(--spot-violet);
}

[data-spotted-color="peach"] {
  --spotted-card-border: var(--border-spot-peach);
  --spotted-card-background: var(--spot-peach);
}

[data-spotted-color="mint"] {
  --spotted-card-border: var(--border-spot-mint);
  --spotted-card-background: var(--spot-mint);
}

[data-spotted-color="pink"] {
  --spotted-card-border: var(--border-spot-pink);
  --spotted-card-background: var(--spot-pink);
}

[data-spotted-color="lime"] {
  --spotted-card-border: var(--border-spot-lime);
  --spotted-card-background: var(--spot-lime);
}

[data-spotted-color="sky"] {
  --spotted-card-border: var(--border-spot-sky);
  --spotted-card-background: var(--spot-sky);
}

.spotted-message-logo {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 64px;
  height: auto;
  transform: translateX(-50%);
  filter: brightness(0) saturate(100%) invert(7%) sepia(62%) saturate(1307%) hue-rotate(186deg) brightness(94%) contrast(101%);
  pointer-events: none;
}

.spotted-message-card .spotted-pending-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  margin: 0;
  padding: 4px var(--space-1);
  border: 1px solid var(--warning-line);
  background: var(--warning-surface);
  color: var(--warning-main);
  font-size: 0.66rem;
}

.spotted-message-more {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
}

.spotted-message-more .card-more-btn {
  width: 38px;
  height: 38px;
  background: rgba(var(--color-white-rgb), 0.58);
  color: var(--spot-card-muted);
}

.spotted-page .spotted-ig-body {
  padding: 0;
  background: transparent;
}

.spotted-page .spotted-ig-text {
  color: var(--spot-card-ink);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.spotted-message-card .spotted-ig-time {
  position: absolute;
  bottom: 14px;
  left: 50%;
  color: var(--spot-card-time);
  font-size: 0.7rem;
  font-weight: 500;
  transform: translateX(-50%);
  white-space: nowrap;
}

.spotted-card-actions {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 12px;
  z-index: 4;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.spotted-page .spotted-card-actions .btn-like,
.spotted-page .spotted-card-actions .btn-comment {
  position: relative;
  width: auto;
  min-width: 48px;
  min-height: 44px;
  padding: var(--space-1);
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--spot-card-action);
  box-shadow: none;
  pointer-events: auto;
  transition: transform 160ms ease, color 160ms ease;
}

.spotted-page .spotted-card-actions .btn-like:hover,
.spotted-page .spotted-card-actions .btn-comment:hover {
  background: transparent;
  color: var(--spot-card-action-hover);
  box-shadow: none;
  transform: translateY(-2px);
}

.spotted-page .spotted-card-actions .btn-like:active,
.spotted-page .spotted-card-actions .btn-comment:active {
  transform: scale(0.95);
}

.spotted-page .spotted-card-actions .btn-like.liked {
  border-color: transparent;
  background: transparent;
  color: var(--error);
}

.spotted-page .spotted-card-actions .btn-comment[aria-expanded="true"] {
  color: var(--primary);
}

.spotted-card-actions .like-count,
.spotted-card-actions .comment-count {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
}

.spotted-comments-dialog {
  box-sizing: border-box;
  width: min(520px, calc(100% - 32px));
  max-width: none;
  max-height: min(76dvh, 680px);
  margin: auto;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent 12%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-main);
  box-shadow: 0 28px 70px var(--spot-dialog-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.975);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.spotted-comments-dialog.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.spotted-comments-dialog::backdrop {
  background: var(--spot-dialog-backdrop);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.spotted-comments-modal {
  display: flex;
  width: 100%;
  min-width: 0;
  max-height: min(76dvh, 680px);
  flex-direction: column;
}

.spotted-comments-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 18px 13px;
  border-bottom: 1px solid var(--border);
}

.spotted-comments-modal-header h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
}

.spotted-comments-modal-header p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.spotted-comments-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.spotted-comments-modal-close:hover {
  background: var(--border);
  transform: rotate(4deg);
}

.spotted-comments-dialog .spotted-comments-modal-list {
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-height: min(52dvh, 430px);
  margin: 0;
  padding: 5px 18px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.spotted-comments-dialog .comment {
  display: block;
  padding: var(--space-2) 0 10px;
  border-color: color-mix(in srgb, var(--border) 72%, transparent 28%);
}

.spotted-comments-dialog .comment-body {
  min-width: 0;
  line-height: 1.45;
}

.spotted-comments-dialog .comment-author {
  margin-right: 7px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
}

.spotted-comments-dialog .comment-text {
  color: var(--text-main);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.spotted-comments-dialog .comment-meta {
  justify-content: flex-start;
  gap: 10px;
  margin-top: 5px;
  font-size: 0.67rem;
}

.spotted-comments-dialog .btn-delete-comment {
  padding: 0;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
}

.spotted-comments-dialog .btn-delete-comment:hover {
  color: var(--error);
}

.spotted-comments-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 52px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.spotted-comments-dialog .spotted-comments-loading {
  min-height: 112px;
}

.spotted-comments-loading span {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spotted-comments-dialog .comment-empty-text,
.spotted-comments-dialog .comment-error-text {
  min-height: 112px;
  margin: 0;
  padding: 39px var(--space-1);
  text-align: center;
  font-size: 0.8rem;
}

.spotted-comments-dialog .comment-form {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.spotted-comments-dialog .comment-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
}

.spotted-comments-dialog .comment-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.spotted-comments-dialog .comment-submit-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 6px 4px 6px 10px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.spotted-comments-dialog .comment-submit-btn:hover {
  background: transparent;
  color: var(--primary-hover);
}

.spotted-comments-dialog .comment-input-wrap {
  position: relative;
}

.spotted-comments-dialog .comment-mention-suggestions {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 8;
  max-height: min(220px, 35dvh);
  margin: 0;
}

@media (max-width: 520px) {
  .spotted-page {
    padding-top: var(--space-2);
  }

  .spotted-page .compose-header {
    padding: var(--space-3) 0;
  }

  .spotted-page .compose-body {
    padding: 0 0 var(--space-3);
  }

  .spotted-destination-heading {
    display: block;
  }

  .spotted-destination-heading small {
    display: block;
    margin-top: 2px;
  }

  .spotted-destination-controls {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .spotted-page .compose-submit-btn {
    width: 100%;
    margin-left: 0;
  }

  .spotted-page .spotted-public-link-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .spotted-page .spotted-public-link-actions .btn {
    width: 100%;
  }

  .spotted-page #spotted-list {
    min-height: 280px;
    padding-bottom: var(--space-5);
  }

  .spotted-message-card {
    min-height: 232px;
    padding: 66px 18px 60px;
  }

  .spotted-message-logo {
    top: 16px;
    width: 54px;
  }

  .spotted-page .spotted-ig-text {
    font-size: 0.96rem;
  }

  .spotted-card-actions {
    right: 8px;
    bottom: 6px;
    left: 8px;
  }

  .spotted-page .spotted-card-actions .btn-like,
  .spotted-page .spotted-card-actions .btn-comment {
    min-width: 46px;
    min-height: 42px;
  }

  .spotted-comments-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 82dvh;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }

  .spotted-comments-dialog.is-visible {
    transform: translateY(0);
  }

  .spotted-comments-modal {
    max-height: 82dvh;
  }

  .spotted-comments-modal-header {
    position: relative;
    padding-top: 21px;
  }

  .spotted-comments-modal-header::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--border);
    transform: translateX(-50%);
  }

  .spotted-comments-dialog .spotted-comments-modal-list {
    max-height: calc(82dvh - 142px);
    padding-right: var(--space-3);
    padding-left: var(--space-3);
  }
}

@media (max-width: 520px) {
  .spotted-feed-header {
    align-items: center;
  }

  .spotted-feed-header p {
    max-width: 24ch;
  }

  .spotted-deck-controls button {
    width: 34px;
    height: 34px;
  }

  .spotted-deck-controls output {
    min-width: 34px;
  }

  .spotted-page .spotted-ig-card {
    width: min(390px, calc(100% - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {

  .spotted-page #spotted-list,
  .spotted-page .spotted-ig-card,
  .spotted-comments-dialog,
  .spotted-deck-controls button {
    transition-duration: 0.01ms !important;
  }

  .spotted-comments-loading span {
    animation-duration: 1.4s;
  }
}
