/* Chats & photos: first choice, settings and My gallery (assets/my-data.js). */

.dc-overlay {
  position: fixed; inset: 0; z-index: 480; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, rgba(79,209,224,0.10), transparent 60%), rgba(4,6,10,0.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: dc-in .3s ease;
}
.dc-overlay.dc-leaving { opacity: 0; transition: opacity .25s ease; }
.dc-modal { display: none; z-index: 420; background: rgba(5,7,12,0.78); }
.dc-modal.open { display: flex; }
@keyframes dc-in { from { opacity: 0; } to { opacity: 1; } }

.dc-panel {
  width: 100%; max-width: 860px; margin: auto; text-align: center;
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid var(--border);
  border-radius: 22px; padding: 34px 32px 26px; box-shadow: var(--shadow-lg); position: relative;
}
.dc-panel-sm { max-width: 520px; text-align: left; padding: 28px 26px 22px; }
.dc-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.dc-panel h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2.1rem); color: var(--bright); margin: 8px 0 8px; line-height: 1.2; }
.dc-panel h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; color: var(--bright); margin: 0 0 14px; }
.dc-lead { color: var(--dim); font-size: .95rem; line-height: 1.5; max-width: 560px; margin: 0 auto 24px; }
.dc-lead strong { color: var(--text); }

.dc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dc-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 22px 20px 18px; border-radius: 18px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.dc-option:hover:not(:disabled), .dc-option:focus-visible { transform: translateY(-2px); outline: none; }
.dc-option-saved:hover:not(:disabled), .dc-option-saved:focus-visible { border-color: var(--teal); box-shadow: 0 10px 34px -12px rgba(79,209,224,0.45); }
.dc-option-local:hover:not(:disabled), .dc-option-local:focus-visible { border-color: var(--purple); box-shadow: 0 10px 34px -12px rgba(181,144,240,0.45); }
.dc-option:disabled { opacity: .55; cursor: wait; }
.dc-icon { font-size: 1.9rem; line-height: 1; }
.dc-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--bright); margin-top: 4px; }
.dc-sub { font-size: .82rem; color: var(--dim); }
.dc-list { display: flex; flex-direction: column; gap: 9px; margin: 14px 0 18px; font-size: .88rem; line-height: 1.4; }
.dc-list span { position: relative; padding-left: 24px; }
.dc-list span::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.dc-option-saved .dc-list span::before { content: '✓'; color: var(--teal); }
.dc-option-local .dc-list span::before { content: '•'; color: var(--purple); font-size: 1.1rem; line-height: 1.1; }
.dc-list strong { color: var(--bright); }
.dc-cta {
  margin-top: auto; align-self: stretch; text-align: center; padding: 11px 14px; border-radius: 12px;
  font-weight: 700; font-size: .9rem;
}
.dc-option-saved .dc-cta { background: var(--teal); color: #05222a; }
.dc-option-local .dc-cta { background: var(--purple-soft); color: var(--purple); border: 1px solid var(--purple-dim); }
.dc-foot { color: var(--muted); font-size: .8rem; margin: 18px 0 0; }
.dc-error { color: var(--coral); font-size: .85rem; margin-top: 10px; min-height: 1em; }

/* Settings */
.ds-loading { color: var(--dim); margin: 0; }
.ds-close { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--dim); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.ds-close:hover { color: var(--bright); }
.ds-current { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--purple-soft); border: 1px solid var(--purple-dim); margin-bottom: 16px; }
.ds-current-saved { background: var(--teal-soft); border-color: var(--teal-dim); }
.ds-current strong { display: block; color: var(--bright); font-size: 1rem; }
.ds-current span:not(.dc-icon) { display: block; color: var(--dim); font-size: .84rem; margin-top: 2px; line-height: 1.4; }
.ds-warning { border-radius: 14px; padding: 16px; font-size: .88rem; line-height: 1.5; }
.ds-warning > strong { display: block; font-size: .98rem; margin-bottom: 6px; }
.ds-warning p { margin: 0 0 8px; color: var(--text); }
.ds-danger { background: rgba(242,103,79,0.10); border: 1.5px solid var(--coral); }
.ds-danger > strong { color: #ff9c8a; }
.ds-notice { background: rgba(232,189,90,0.09); border: 1.5px solid var(--gold); }
.ds-notice > strong { color: var(--gold); }
.ds-confirm { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; color: var(--bright); font-weight: 600; }
.ds-confirm input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--coral); }
.ds-notice .ds-confirm input { accent-color: var(--teal); }
.ds-link { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; }
.ds-btn { width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.ds-btn:disabled { opacity: .4; cursor: not-allowed; }
.ds-btn-danger { background: var(--coral); color: #fff; }
.ds-btn-primary { background: var(--teal); color: #05222a; }

/* My gallery */
#my-gallery {
  position: fixed; inset: 0; z-index: 250; display: none; flex-direction: column; overflow-y: auto;
  background: var(--bg); padding: 0 max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
#my-gallery.open { display: flex; }
body.mg-open { overflow: hidden; }
.mg-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px;
  padding: 14px 0 12px; background: linear-gradient(180deg, var(--bg) 80%, transparent);
}
.mg-heading { flex: 1; min-width: 0; }
.mg-heading h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; color: var(--bright); margin: 0; }
.mg-meta { color: var(--dim); font-size: .82rem; }
.mg-back, .mg-settings {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px;
  padding: 7px 14px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.mg-back:hover, .mg-settings:hover { border-color: var(--teal-dim); color: var(--bright); }
.mg-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mg-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--dim); border-radius: 99px;
  padding: 6px 12px; font: inherit; font-size: .8rem; cursor: pointer;
}
.mg-chip span { color: var(--muted); margin-left: 3px; }
.mg-chip.active { border-color: var(--teal); color: var(--bright); background: var(--teal-soft); }
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mg-tile { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); aspect-ratio: 3 / 4; }
.mg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.mg-tile-info {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 6px;
  padding: 22px 10px 8px; font-size: .72rem; color: var(--bright); pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(3,5,9,0.85));
}
.mg-tile-info span:first-child { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-tile-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.mg-act {
  width: 34px; height: 34px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(3,5,9,0.72); color: var(--bright); font-size: 1rem; cursor: pointer; text-decoration: none;
}
.mg-act:hover { background: rgba(3,5,9,0.92); }
.mg-confirm {
  position: absolute; inset: auto 8px 8px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center;
  padding: 10px; border-radius: 10px; background: rgba(10,12,17,0.95); border: 1px solid var(--coral-dim); font-size: .8rem; color: var(--bright);
}
.mg-confirm[hidden] { display: none; }
.mg-confirm span { width: 100%; text-align: center; }
.mg-confirm button { border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-weight: 700; cursor: pointer; }
.mg-yes { background: var(--coral); color: #fff; }
.mg-no { background: var(--raised); color: var(--text); }
.mg-empty { text-align: center; color: var(--dim); max-width: 420px; margin: 60px auto; line-height: 1.5; }
.mg-empty strong { display: block; color: var(--bright); font-size: 1.1rem; margin-bottom: 6px; }
.mg-empty .ds-btn { width: auto; padding: 11px 20px; margin-top: 8px; }
.mg-empty-icon { font-size: 2.4rem; margin-bottom: 8px; }
.mg-more { align-self: center; margin-top: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: 9px 22px; font: inherit; cursor: pointer; }
.mg-more[hidden] { display: none; }

/* Topbar button and chat details */
.btn-gallery { font-size: 0.78rem; font-weight: 600; color: var(--purple); background: var(--purple-soft); border: 1px solid var(--purple-dim); border-radius: 99px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.btn-gallery:hover { background: rgba(181,144,240,0.18); }
.msg-img-saved { font-size: .72rem; color: var(--teal); margin-top: 6px; }

@media (max-width: 760px) {
  .dc-overlay { align-items: flex-start; }
  .dc-panel { padding: 26px 18px 20px; border-radius: 18px; }
  .dc-options { grid-template-columns: 1fr; }
  .dc-list { margin: 10px 0 14px; }
  .btn-gallery { padding: 6px 8px; font-size: .72rem; }
  .btn-gallery .btn-gallery-label { display: none; }
  .mg-head { flex-wrap: wrap; }
  .mg-heading { order: -1; flex-basis: 100%; }
  .mg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mg-act { width: 38px; height: 38px; }
}
