/* Her look builder, photo library and viewer (js/images.js). */
[hidden] { display: none !important; }

.look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.look-field span { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.look-field .form-select { padding: 0.6rem 0.75rem; font-size: 0.9rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }

.level-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.level-option { flex: 1; min-width: 110px; cursor: pointer; }
.level-option input { position: absolute; opacity: 0; pointer-events: none; }
.level-option span {
  display: block; padding: 0.65rem 0.5rem; text-align: center; font-size: 0.85rem;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all 0.3s;
}
.level-option span small { display: block; font-size: 0.7rem; color: var(--gold); margin-top: 0.15rem; }
.level-option:hover span { border-color: var(--border-hover); }
.level-option input:checked + span { border-color: var(--pink); background: var(--pink-subtle); color: var(--pink-light); }
.level-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255, 45, 138, 0.25); }
.level-option.locked { cursor: not-allowed; }
.level-option.locked span { opacity: 0.55; }

.portrait-preview, .doll-card-avatar-pending {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
  color: var(--text-secondary); font-size: 0.9rem; text-align: center;
  background: var(--bg-input);
}
.portrait-preview {
  aspect-ratio: 3 / 4; max-height: 55vh; margin: 0 auto 1.5rem;
  border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
}
.portrait-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-preview > span:not(.loading-spinner) { padding: 0 1rem; }

.image-library { max-width: 1200px; margin: 3rem auto 0; }
.gallery-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.gallery-usage { color: var(--text-secondary); font-size: 0.9rem; }
.gallery-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.gallery-chip {
  padding: 0.35rem 0.9rem; border-radius: var(--radius-full); cursor: pointer;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); font: inherit; font-size: 0.85rem;
}
.gallery-chip.active { border-color: var(--pink); color: var(--pink-light); background: var(--pink-subtle); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.gallery-tile {
  position: relative; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card);
}
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.gallery-tile:hover img { transform: scale(1.03); }
.gallery-tile-msg {
  cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  color: var(--text-secondary); font-size: 0.85rem; text-align: center; padding: 1rem;
}
.gallery-tag {
  position: absolute; left: 0.5rem; top: 0.5rem; padding: 0.1rem 0.5rem; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem;
}
.gallery-empty { color: var(--text-secondary); padding: 2rem 0; }

.viewer img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius); display: block; background: #000; }
.viewer-meta { color: var(--text-secondary); font-size: 0.85rem; margin: 0.75rem 0; word-break: break-word; }
.viewer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.viewer-delete { color: #ff6b6b; }

@media (max-width: 520px) {
  .look-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .level-option { min-width: 90px; }
}

/* Photos she sends in chat (js/chat.js) */
.chat-photo-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--pink-light);
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s;
}
.chat-photo-btn svg { width: 20px; height: 20px; }
.chat-photo-btn:hover { border-color: var(--pink); box-shadow: var(--shadow-glow); }
.chat-photo-btn:disabled { opacity: 0.5; cursor: wait; }
.chat-bubble.chat-photo {
  flex-shrink: 0; /* a long chat must not squash it under the image */
  padding: 0.4rem; width: min(320px, 75%); min-height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
}
.chat-bubble.chat-photo img { width: 100%; border-radius: calc(var(--radius-lg) - 6px); display: block; cursor: zoom-in; }
.chat-photo-note { color: var(--text-secondary); font-size: 0.85rem; padding: 0 0.75rem; text-align: center; }

/* Her voice: speaker button at the end of her messages */
.chat-voice-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 28px; height: 28px; margin-left: 0.4rem; padding: 0; border-radius: 50%;
  background: transparent; border: 1px solid var(--border); color: var(--pink-light); cursor: pointer;
  transition: all 0.2s;
}
.chat-voice-btn svg { width: 15px; height: 15px; }
.chat-voice-btn:hover, .chat-voice-btn[data-state="playing"] { border-color: var(--pink); box-shadow: var(--shadow-glow); }
.chat-voice-btn .loading-spinner { width: 14px; height: 14px; border-width: 2px; margin: 0; }

/* "This is me" under photos of him */
.chat-photo-me {
  align-self: center; padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--pink-light); transition: all 0.2s;
}
.chat-photo-me:hover { border-color: var(--pink); box-shadow: var(--shadow-glow); }
.chat-photo-me:disabled { cursor: default; opacity: 0.85; }

/* Your look (My Dolls) */
.my-look { margin-top: 2rem; }
.my-look-card {
  display: flex; gap: 1.25rem; align-items: center; padding: 1rem 1.25rem;
  background: var(--bg-card, rgba(255,255,255,0.03)); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px);
}
.my-look-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: top; flex-shrink: 0; border: 2px solid var(--pink); }
.my-look-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--text-secondary); background: var(--bg-input); }
.my-look-body h3 { margin: 0 0 0.25rem; }
.my-look-body p { margin: 0 0 0.75rem; color: var(--text-secondary); font-size: 0.9rem; }
.my-look-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.my-look-preview { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin: 1rem 0; color: var(--text-secondary); }
.my-look-preview img { width: min(320px, 100%); border-radius: var(--radius-lg, 16px); }
@media (max-width: 520px) { .my-look-card { flex-direction: column; text-align: center; } .my-look-actions { justify-content: center; } }
.chat-photo-picks { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem; }

/* Upsell card in chat (photos in chat are a Premium perk) */
.chat-bubble.chat-upsell { border: 1px solid var(--pink); background: rgba(255, 64, 160, 0.08); }
.chat-bubble.chat-upsell a { color: var(--pink-light); font-weight: 600; white-space: nowrap; }

/* Small status light by the logo: is the chat model up? */
.site-status { display: inline-flex; vertical-align: middle; font-family: var(--font-body); font-weight: 400; text-transform: none; align-items: center; gap: 0.35rem; margin-left: 0.75rem; font-size: 0.72rem;
  color: var(--text-muted); letter-spacing: 0.04em; white-space: nowrap; }
.site-status i { width: 7px; height: 7px; border-radius: 50%; background: #666; }
.site-status.online i { background: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.site-status.offline i { background: #888; }
@media (max-width: 600px) { .site-status b { display: none; } }
