/* auth.css — ProBroker AI authentication overlay + user header area */

/* ── Auth overlay ─────────────────────────────────────────────────────────── */

#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 12, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#auth-overlay.hidden {
  display: none;
}

.auth-modal {
  background: #12151f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.auth-modal-close:hover { color: rgba(255,255,255,0.75); }

.auth-modal-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}

.auth-modal-logo img {
  width: 240px;
  height: auto;
  max-width: 100%;
}

.auth-modal-tagline {
  font-size: 13px;
  font-weight: 400;
  color: rgba(147, 163, 184, 0.75);
  letter-spacing: 0.01em;
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 420px) {
  .auth-modal-logo img {
    width: 190px;
    height: auto;
    max-width: 85vw;
  }
  .auth-modal-tagline {
    font-size: 12px;
  }
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.auth-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab-btn {
  flex: 1;
  padding: 7px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab-btn:hover { color: rgba(255,255,255,0.7); }
.auth-tab-btn.active {
  background: rgba(255,255,255,0.1);
  color: #e8eaf0;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */

.auth-form-panel.hidden { display: none; }

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e8eaf0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.auth-field input:focus {
  border-color: rgba(138, 180, 248, 0.5);
  background: rgba(255,255,255,0.08);
}
.auth-field input::placeholder { color: rgba(255,255,255,0.2); }

.auth-error {
  font-size: 12.5px;
  color: #f28b82;
  margin-bottom: 12px;
  min-height: 16px;
}
.auth-error.hidden { display: none; }

/* ── Inline per-field validation errors ──────────────────────────────────── */

.field-error {
  display: block;
  font-size: 11.5px;
  color: #f28b82;
  margin-top: 4px;
  line-height: 1.4;
}
.field-error.hidden { display: none; }

.auth-field input.input-invalid {
  border-color: rgba(242, 139, 130, 0.7);
  background: rgba(242, 139, 130, 0.05);
}
.auth-field input.input-invalid:focus {
  border-color: rgba(242, 139, 130, 0.9);
}

/* ── Forgot password row ─────────────────────────────────────────────────── */

.auth-forgot {
  text-align: right;
  margin-top: -6px;
  margin-bottom: 14px;
}
.auth-forgot .auth-link-btn {
  font-size: 12px;
}

.auth-submit-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}
.auth-submit-btn:hover:not(:disabled) { opacity: 0.88; }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-hint {
  font-size: 11.5px;
  color: rgba(255,255,255,0.3);
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
}

/* ── Password hint / strength note ───────────────────────────────────────── */

.auth-pw-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.28);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── Google Sign-In section ───────────────────────────────────────────────── */

.auth-google-section {
  margin-top: 16px;
}
.auth-google-section.hidden { display: none; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.2);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* Container for our custom Google button */
.google-signin-container {
  position: relative;
}

/* Hidden GIS button — kept in DOM so GIS OAuth flow works, never visible */
.google-gis-hidden {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

/* Premium dark-glass Google button */
.google-custom-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #e8eaf0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.google-custom-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
}
.google-custom-btn:active { background: rgba(255,255,255,0.13); }

.google-g-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Phone / country code selector ───────────────────────────────────────── */

.phone-input-row {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: visible;
  background: rgba(255,255,255,0.06);
  transition: border-color 0.15s, background 0.15s;
}
.phone-input-row:focus-within {
  border-color: rgba(138,180,248,0.5);
  background: rgba(255,255,255,0.08);
}

.phone-country-wrap {
  position: relative;
  flex-shrink: 0;
}

.phone-country-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 10px 10px 12px;
  background: none;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px 0 0 8px;
  color: #e8eaf0;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
  min-width: 84px;
}
.phone-country-btn:hover { background: rgba(255,255,255,0.06); }

.phone-country-flag { font-size: 16px; line-height: 1; }
.phone-country-dialcode { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }
.phone-chevron { font-size: 9px; color: rgba(255,255,255,0.35); margin-left: 2px; }

/* Dropdown panel */
.phone-country-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 9999;
  width: 260px;
  max-height: 240px;
  overflow: hidden;
  background: #1a1e2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}
.phone-country-dropdown.hidden { display: none; }

.phone-country-search-wrap {
  padding: 8px 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.phone-country-search {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #e8eaf0;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.phone-country-search::placeholder { color: rgba(255,255,255,0.25); }
.phone-country-search:focus { border-color: rgba(138,180,248,0.4); }

.phone-country-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
}
.phone-country-list::-webkit-scrollbar { width: 4px; }
.phone-country-list::-webkit-scrollbar-track { background: transparent; }
.phone-country-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.phone-country-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #cdd3e0;
  transition: background 0.1s;
}
.phone-country-item:hover { background: rgba(255,255,255,0.07); }
.pci-flag { font-size: 15px; flex-shrink: 0; }
.pci-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pci-dial { font-size: 12px; color: rgba(255,255,255,0.35); flex-shrink: 0; }

/* Number input — right side of the phone row */
.phone-number-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 0 8px 8px 0;
  color: #e8eaf0;
  font-size: 14px;
  outline: none;
}
.phone-number-input::placeholder { color: rgba(255,255,255,0.2); }

/* Error state propagated to the row */
.phone-input-row.input-invalid {
  border-color: rgba(242,139,130,0.7);
  background: rgba(242,139,130,0.05);
}

@media (max-width: 420px) {
  .phone-country-dropdown { width: 220px; }
  .phone-country-btn { min-width: 76px; padding-left: 10px; }
}

/* ── Header user area ─────────────────────────────────────────────────────── */

#auth-user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 8px;
}

.auth-sign-in-btn {
  padding: 5px 14px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 6px;
  color: #a5b4fc;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.auth-sign-in-btn:hover {
  background: rgba(99,102,241,0.28);
  border-color: rgba(99,102,241,0.6);
}

/* ── Credit badge (top bar) ───────────────────────────────────────────────── */
.auth-credit-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 34px;
  background: rgba(8, 22, 38, 0.92);
  border: 1px solid rgba(52, 198, 244, 0.35);
  border-radius: 20px;
  color: rgba(255,255,255,0.82);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(52,198,244,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
  cursor: default;
  user-select: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.auth-credit-badge:hover {
  border-color: rgba(52, 198, 244, 0.55);
  box-shadow: 0 0 24px rgba(52,198,244,0.14), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Low (≤2 credits) — soft amber warning */
.auth-credit-badge--low {
  border-color: rgba(251, 146, 60, 0.45);
  color: #fed7aa;
  box-shadow: 0 0 18px rgba(251,146,60,0.1), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Zero credits — muted red-rose */
.auth-credit-badge--empty {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  box-shadow: 0 0 16px rgba(239,68,68,0.1), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Mobile: hide header badges — credits/plan accessible in profile dropdown */
@media (max-width: 767px) {
  .auth-credit-badge { display: none; }
  .auth-plan-badge   { display: none; }
}

/* ── Plan badge (top bar) ─────────────────────────────────────────────────── */
.auth-plan-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
}
.auth-plan-badge--free {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.35);
}
.auth-plan-badge--starter {
  background: rgba(52,198,244,0.1);
  border-color: rgba(52,198,244,0.3);
  color: #34c6f4;
}
.auth-plan-badge--professional {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.35);
  color: #a5b4fc;
}
.auth-plan-badge--studio {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.35);
  color: #d8b4fe;
}
.auth-plan-badge--enterprise {
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.3);
  color: #fde68a;
}
.auth-plan-badge--owner_unlimited {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.4);
  color: #6ee7b7;
}
.auth-plan-badge--loading {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.25);
  animation: plan-badge-pulse 1.4s ease-in-out infinite;
}
@keyframes plan-badge-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ── Plan badge inside dropdown item ─────────────────────────────────────── */
.ddi-plan-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
}
.ddi-plan-badge--free         { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.35); }
.ddi-plan-badge--starter      { background: rgba(52,198,244,0.1);   border-color: rgba(52,198,244,0.3);   color: #34c6f4; }
.ddi-plan-badge--professional { background: rgba(99,102,241,0.12);  border-color: rgba(99,102,241,0.35);  color: #a5b4fc; }
.ddi-plan-badge--studio       { background: rgba(168,85,247,0.12);  border-color: rgba(168,85,247,0.35);  color: #d8b4fe; }
.ddi-plan-badge--enterprise   { background: rgba(251,191,36,0.1);   border-color: rgba(251,191,36,0.3);   color: #fde68a; }
.ddi-plan-badge--owner        { background: rgba(16,185,129,0.12);  border-color: rgba(16,185,129,0.4);   color: #6ee7b7; }

/* Owner card */
.ddi-owner-card {
  border-color: rgba(16,185,129,0.25) !important;
}
.ddi-owner-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #6ee7b7;
  padding: 4px 0 2px;
}

/* ── Upgrade prompt / locked feature ─────────────────────────────────────── */
.mode-card--locked {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  position: relative;
}
.mode-card--locked::after {
  content: '🔒 Upgrade';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.4);
  padding: 2px 7px;
  border-radius: 8px;
}

.auth-email-label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-history-btn,
.auth-signout-btn {
  padding: 4px 10px;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.auth-history-btn:hover,
.auth-signout-btn:hover {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.75);
}

/* ── History panel ────────────────────────────────────────────────────────── */

#history-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 360px;
  background: #12151f;
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 800;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
}
#history-panel.hidden { display: none; }

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.history-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #e8eaf0;
}

#btn-history-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
#btn-history-close:hover { color: rgba(255,255,255,0.75); }

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.history-loading,
.history-empty,
.history-error {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.1s;
}
.history-item:hover { background: rgba(255,255,255,0.04); }

.history-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
}
.history-thumb--missing { border: 1px solid rgba(255,255,255,0.08); }

.history-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item-name {
  font-size: 12.5px;
  color: #d0d4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-transform: capitalize;
}

.history-item-status {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.history-status--done    { color: #4ade80; }
.history-status--partial { color: #fbbf24; }
.history-status--error   { color: #f87171; }
.history-status--processing,
.history-status--queued  { color: #60a5fa; }
.history-status--unknown { color: rgba(255,255,255,0.25); }

.history-item-actions {
  flex-shrink: 0;
}

.history-dl-btn {
  font-size: 14px;
  padding: 4px 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.history-dl-btn:hover {
  color: #e8eaf0;
  border-color: rgba(255,255,255,0.3);
}

/* Mobile: full-width history panel */
@media (max-width: 600px) {
  #history-panel { width: 100%; }
  .auth-email-label { display: none; }
  .auth-history-btn { display: none; }
}

/* ── Profile dropdown ─────────────────────────────────────────────────────── */

.profile-dropdown-wrap {
  position: relative;
}

.profile-avatar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 4px 10px 4px 5px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.profile-avatar-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar--lg  { width: 44px;  height: 44px;  }
.profile-avatar--xl  { width: 80px;  height: 80px;  font-size: 28px; border-radius: 12px; }

.profile-avatar-img  { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-initials {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
}
.profile-avatar--lg  .profile-avatar-initials { font-size: 16px; }
.profile-avatar--xl  .profile-avatar-initials { font-size: 28px; }

.profile-name-label {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-chevron {
  color: rgba(255,255,255,0.35);
  transition: transform 0.15s;
  flex-shrink: 0;
}
.profile-avatar-btn[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }

/* Dropdown panel */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: #1a1d2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.12s ease;
}
.profile-dropdown.hidden { display: none; }

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
}
.profile-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.profile-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: #e8eaf0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.profile-dropdown-email {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.profile-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 2px 0;
}
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.profile-dropdown-item:hover { background: rgba(255,255,255,0.06); color: #e8eaf0; }
.profile-dropdown-item svg   { flex-shrink: 0; opacity: 0.6; }
.profile-dropdown-item--danger { color: rgba(248,113,113,0.8); }
.profile-dropdown-item--danger:hover { color: #f87171; background: rgba(239,68,68,0.08); }

/* ── Premium usage block inside dropdown ─────────────────────────────────── */
.ddi-usage-block {
  padding: 10px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: default;
  user-select: none;
}
.ddi-usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ddi-usage-title {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.ddi-usage-subtext {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.ddi-usage-main {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  margin-bottom: 8px;
  line-height: 1.3;
}
.ddi-usage-bar {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.ddi-usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #34c6f4, #6366f1);
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* ── Free Plan card inside dropdown ─────────────────────────────────────── */
.ddi-plan-card {
  background: rgba(52,198,244,0.04);
  border-color: rgba(52,198,244,0.18);
}
.ddi-plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ddi-pc-label {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.ddi-plan-includes {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ddi-pi-row {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ddi-pi-check {
  color: #34c6f4;
  font-size: 10px;
  font-weight: 700;
}

/* ── Creative Trials section inside Free Plan card ──────────────────────── */
.ddi-creative-trials {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ddi-ct-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.28);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.ddi-ct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}
.ddi-ct-tool {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}
.ddi-ct-val {
  font-size: 11px;
  color: #34c6f4;
  font-weight: 600;
}
.ddi-ct-val--used {
  color: rgba(255,255,255,0.25);
  text-decoration: line-through;
  font-weight: 400;
}

/* ── Upgrade plan buttons inside free-plan card ──────────────────────────── */
.ddi-upgrade-plans {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ddi-upgrade-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ddi-upgrade-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85);
}
.ddi-upgrade-btn--highlight {
  background: rgba(99,102,241,0.14);
  border-color: rgba(99,102,241,0.40);
  color: #a5b4fc;
}
.ddi-upgrade-btn--highlight:hover {
  background: rgba(99,102,241,0.24);
  border-color: rgba(99,102,241,0.60);
  color: #c7d2fe;
}

/* ── Billing row right-side meta (legacy — kept for safety) ──────────────── */
.ddi-billing-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ddi-billing-plan-label {
  font-size: 10.5px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
}

/* ── Billing row redesign ─────────────────────────────────────────────────── */
.ddi-billing-row {
  padding: 13px 16px;
  align-items: center;
}

.ddi-billing-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ddi-billing-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  white-space: nowrap;
  line-height: 1.3;
}

.ddi-billing-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.38);
  white-space: nowrap;
  line-height: 1.3;
}

.ddi-billing-pill {
  flex-shrink: 0;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.025em;
  border: 1px solid;
  white-space: nowrap;
}

.ddi-billing-pill--upgrade      { background: rgba(52,198,244,0.16);  border-color: rgba(52,198,244,0.50);  color: #34c6f4; font-weight: 700; letter-spacing: 0.03em; }
.ddi-billing-pill--starter      { background: rgba(52,198,244,0.10);  border-color: rgba(52,198,244,0.30);  color: #34c6f4; }
.ddi-billing-pill--professional { background: rgba(99,102,241,0.12);  border-color: rgba(99,102,241,0.35);  color: #a5b4fc; }
.ddi-billing-pill--studio       { background: rgba(168,85,247,0.12);  border-color: rgba(168,85,247,0.35);  color: #d8b4fe; }
.ddi-billing-pill--enterprise   { background: rgba(251,191,36,0.10);  border-color: rgba(251,191,36,0.30);  color: #fde68a; }
.ddi-billing-pill--owner_unlimited { background: rgba(16,185,129,0.14); border-color: rgba(16,185,129,0.42); color: #6ee7b7; }

/* Urgent sub text (free user, 0 credits) */
.ddi-billing-sub--urgent {
  color: rgba(250,180,80,0.75);
}

/* Free-user billing row: subtle cyan left accent on hover to signal upgrade intent */
.ddi-billing-row--free:hover {
  border-left: 2px solid rgba(52,198,244,0.45);
  padding-left: 14px;
}
.ddi-billing-row--free:hover .ddi-billing-title {
  color: rgba(255,255,255,0.95);
}

/* ── My Listings panel ───────────────────────────────────────────────────── */

#listings-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  background: #12151f;
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 800;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,0.6);
  animation: panelSlideIn 0.2s ease;
}
#listings-panel.hidden { display: none; }

@keyframes panelSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.listings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
}
.listings-panel-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #e8eaf0;
}
.listings-panel-title-row svg { opacity: 0.7; }
.listings-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #e8eaf0;
  letter-spacing: 0.01em;
}
.listings-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.listings-close-btn:hover { color: rgba(255,255,255,0.75); }

.listings-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

/* Loading state */
.listings-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
}
.listings-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.listings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
  color: rgba(255,255,255,0.28);
  font-size: 13px;
}
.listings-empty-sub { font-size: 11.5px; color: rgba(255,255,255,0.18); }

/* Listing card */
.listing-card {
  display: flex;
  flex-direction: column;
  margin: 8px 12px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}
.listing-card:hover {
  border-color: rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.04);
}

.lc-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}
.lc-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lc-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lc-name {
  font-size: 13px;
  font-weight: 500;
  color: #d0d4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.lc-rename-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.lc-rename-btn:hover { color: rgba(255,255,255,0.65); }
.lc-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.lc-dot { opacity: 0.5; }
.lc-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lc-status--active   { color: #4ade80; }
.lc-status--archived { color: rgba(255,255,255,0.3); }

.lc-enhanced-count { color: rgba(255,255,255,0.45); }

.lc-mode-badge {
  font-size: 10px;
  font-weight: 600;
  color: rgba(165,180,252,0.75);
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 3px;
  padding: 1px 5px;
}

.lc-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.lc-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 6px;
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.lc-btn:hover {
  background: rgba(99,102,241,0.22);
  border-color: rgba(99,102,241,0.5);
  color: #c7d2fe;
}

.lc-dl-btn {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.25);
  color: #6ee7b7;
}
.lc-dl-btn:hover:not(:disabled) {
  background: rgba(16,185,129,0.2);
  border-color: rgba(16,185,129,0.45);
  color: #a7f3d0;
}
.lc-dl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lc-del-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lc-del-btn:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.45);
  color: #fca5a5;
}
.lc-del-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Listings toolbar (New Listing + Clear All) */
.listings-toolbar {
  padding: 10px 14px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 0;
  gap: 8px;
  flex-shrink: 0;
}
.listings-clear-all-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 5px;
  color: rgba(255,255,255,0.65);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.listings-clear-all-btn:not(:disabled):hover {
  color: #fca5a5;
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.08);
}
.listings-clear-all-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

/* Inline confirm row (replaces browser confirm() dialog) */
.lc-confirm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(239,68,68,0.06);
  border-top: 1px solid rgba(239,68,68,0.15);
  border-bottom: 1px solid rgba(239,68,68,0.15);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  animation: lc-confirm-in 0.15s ease;
}
@keyframes lc-confirm-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lc-confirm-row span { flex: 1; }
.lc-confirm-cancel-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.lc-confirm-cancel-btn:hover { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.3); }
.lc-confirm-ok-btn {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 5px;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.lc-confirm-ok-btn:hover { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.6); color: #fecaca; }

/* Toast error inside the listings panel */
.listings-panel-error {
  margin: 10px 16px;
  padding: 8px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 12px;
  animation: lc-confirm-in 0.15s ease;
}

/* Listing detail view */
.ld-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}
.ld-back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
  transition: color 0.15s;
}
.ld-back-btn:hover { color: rgba(255,255,255,0.8); }
.ld-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ld-title {
  font-size: 15px;
  font-weight: 600;
  color: #e8eaf0;
}
.ld-rename-btn-inline {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ld-rename-btn-inline:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.3); }
.ld-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.28);
  margin-top: 3px;
}
.ld-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.ld-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 8px;
}
.ld-toggle-originals-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ld-toggle-originals-btn:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.3); }
.ld-images-grid {
  padding: 8px 8px 0;
}
.ld-img-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.1s;
}
.ld-img-card:hover { background: rgba(255,255,255,0.04); }
.ld-img-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}
.ld-img-thumb--empty {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
}
.ld-img-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ld-img-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ld-img-mode {
  font-size: 10px;
  color: rgba(165,180,252,0.6);
  background: rgba(99,102,241,0.08);
  border-radius: 3px;
  padding: 1px 4px;
}
.ld-img-name {
  font-size: 12px;
  color: #c8ccd8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ld-img-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ld-status--done    { color: #4ade80; }
.ld-status--processing,
.ld-status--queued  { color: #60a5fa; }
.ld-status--error   { color: #f87171; }
.ld-status--uploaded,
.ld-status--unknown { color: rgba(255,255,255,0.3); }

/* ── File retention notices ───────────────────────────────────────────────── */

/* My Listings panel — retention notice below header */
.listings-retention-notice {
  padding: 6px 16px 2px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}

/* Expired image card */
.ld-img-card--expired {
  opacity: 0.55;
}
.ld-img-card--expired:hover { background: none; }

/* Expired thumbnail placeholder */
.ld-img-thumb--expired {
  width: 56px;
  height: 42px;
  border-radius: 5px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ld-img-thumb--expired::after {
  content: '✕';
  font-size: 14px;
  color: rgba(255,255,255,0.2);
}

/* Expired message inside card */
.ld-expired-msg {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  line-height: 1.3;
  margin-top: 2px;
}

/* "Expired" badge in place of download button */
.lc-expired-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(248,113,113,0.6);
  padding: 3px 6px;
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Expiry countdown hint */
.ld-expiry-hint {
  font-size: 10px;
  color: rgba(251,191,36,0.6);
  background: rgba(251,191,36,0.06);
  border-radius: 3px;
  padding: 1px 4px;
}

/* ── My Listings redesign: card + toolbar + detail ───────────────────────── */

/* New Listing button in toolbar */
.listings-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: 7px;
  color: #a5b4fc;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.listings-new-btn:hover {
  background: rgba(99,102,241,0.26);
  border-color: rgba(99,102,241,0.55);
  color: #c7d2fe;
}

/* Empty state heading */
.listings-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.42);
  margin: 0 0 4px;
}

/* Thumbnail strip — top section of each listing card */
.lc-thumb-strip {
  display: flex;
  height: 90px;
  gap: 2px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}

.lc-strip-img {
  flex: 1;
  min-width: 0;
  object-fit: cover;
  display: block;
  background: rgba(255,255,255,0.04);
}
.lc-strip-img.lc-strip-img--error {
  opacity: 0.25;
  filter: grayscale(1);
}
.lc-strip-img--empty {
  flex: 1;
  background: rgba(255,255,255,0.03);
}

/* Empty thumbnail strip (no enhanced photos yet) */
.lc-thumb-strip--empty {
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(255,255,255,0.16);
  font-size: 11px;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Card body — below thumbnail strip */
.lc-body {
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Date and count text in card meta row */
.lc-date { color: rgba(255,255,255,0.3); }
.lc-count { color: rgba(255,255,255,0.42); }

/* Expiry countdown badge (orange, shown when ≤ 7 days remain) */
.lc-expiry-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.28);
  color: #fde68a;
}

/* Watermark badge at bottom of card body */
.lc-wm-badge {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(251,191,36,0.05);
  border: 1px solid rgba(251,191,36,0.13);
  border-radius: 6px;
  font-size: 11px;
  color: rgba(251,191,36,0.65);
  line-height: 1.45;
}
.lc-wm-badge svg { flex-shrink: 0; margin-top: 1px; opacity: 0.7; }
.lc-wm-link {
  color: rgba(52,198,244,0.75);
  text-decoration: underline;
  cursor: pointer;
}
.lc-wm-link:hover { color: #34c6f4; }

/* Metadata line in listing detail header */
.ld-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.32);
  margin-top: 4px;
  flex-wrap: wrap;
}

/* Tab bar in listing detail */
.ld-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.ld-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.38);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.ld-tab-btn:hover { color: rgba(255,255,255,0.65); }

.ld-tab-btn--active {
  color: #a5b4fc;
  border-bottom-color: #6366f1;
}

/* Count badge on each tab */
.ld-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.38);
}
.ld-tab-btn--active .ld-tab-count {
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
}

/* Tab content panes */
.ld-tab-pane { padding: 4px 0; }
.ld-tab-pane--hidden { display: none; }

/* Empty state inside a tab pane */
.ld-tab-empty {
  padding: 32px 20px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  line-height: 1.6;
}
.ld-tab-empty-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.18);
  margin: 4px 0 0;
}

/* Informational notice at top of the Originals tab */
.ld-originals-notice {
  margin: 8px 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.38);
  line-height: 1.5;
}

/* Watermark notice wrapper at top of Enhanced tab (free plan) */
.ld-wm-notice {
  margin: 8px 12px 2px;
}

/* Download button on individual image cards in detail view */
.ld-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 5px;
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ld-dl-btn:hover {
  background: rgba(16,185,129,0.2);
  border-color: rgba(16,185,129,0.45);
  color: #a7f3d0;
}
.ld-dl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Profile modal ────────────────────────────────────────────────────────── */

#profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(8,10,18,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
#profile-modal.hidden { display: none; }

.profile-modal-box {
  background: #12151f;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 32px 36px 28px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
}
.profile-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.profile-modal-close:hover { color: rgba(255,255,255,0.7); }

.profile-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.profile-avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-avatar-upload-btn {
  font-size: 12px;
  color: #a5b4fc;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.profile-avatar-upload-btn:hover { background: rgba(99,102,241,0.2); }

.profile-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.profile-field-row {
  display: flex;
  gap: 12px;
}
.profile-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.profile-field label {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-field input {
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e8eaf0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  width: 100%;
}
.profile-field input:focus { border-color: rgba(138,180,248,0.5); }
.profile-field-readonly {
  opacity: 0.55;
  cursor: default;
}
.profile-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.profile-save-btn {
  padding: 10px 24px;
  font-size: 13.5px;
}

/* ── Listing name input in sidebar ───────────────────────────────────────── */

.listing-name-section {
  padding: 8px 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.listing-name-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.listing-name-input {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  color: rgba(255,255,255,0.75);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.listing-name-input:focus {
  border-color: rgba(99,102,241,0.4);
  background: rgba(255,255,255,0.07);
  color: #e8eaf0;
}
.listing-name-input::placeholder { color: rgba(255,255,255,0.2); }

/* ── Image preview error overlay ─────────────────────────────────────────── */

.img-preview-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  padding: 10px 16px;
  color: #fca5a5;
  font-size: 13px;
  pointer-events: none;
}
.img-preview-error.hidden { display: none; }

/* ── Mobile adjustments ──────────────────────────────────────────────────── */

@media (max-width: 767px) {
  #listings-panel        { width: 100%; }
  .profile-modal-box     { margin: 16px; padding: 24px 20px 20px; max-width: none; }
  .profile-field-row     { flex-direction: column; }
  .profile-avatar-btn .profile-name-label { display: none; }
}

/* ── Registration — name row ──────────────────────────────────────────────── */

.auth-field-row {
  display: flex;
  gap: 10px;
}
.auth-field-row .auth-field { flex: 1; min-width: 0; }

/* ── Verification panel ───────────────────────────────────────────────────── */

.verify-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary, #f0f0f0);
  margin: 0 0 6px;
}

.verify-subtitle {
  font-size: 13px;
  color: var(--text-muted, #999);
  margin: 0 0 16px;
}

.verify-status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.verify-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.verify-pending {
  background: rgba(255,200,0,0.12);
  color: #e0b000;
  border: 1px solid rgba(255,200,0,0.25);
}

.verify-done {
  background: rgba(76,175,80,0.15);
  color: #66bb6a;
  border: 1px solid rgba(76,175,80,0.3);
}

.verify-info {
  font-size: 13px;
  color: #66bb6a;
  padding: 6px 0;
  margin-bottom: 6px;
}

.verify-resend-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ── Dev-mode hint in verification panel ──────────────────────────────────── */

.verify-dev-hint {
  font-size: 12px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.verify-dev-hint.hidden { display: none; }

/* ── Contact info (where codes were sent) ────────────────────────────────── */

.verify-contact {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.verify-contact.hidden { display: none; }

.auth-link-btn {
  background: none;
  border: none;
  color: var(--accent, #7c6af7);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.auth-link-btn:hover { color: #a09afc; }

/* Single-photo action rows hidden from normal UI (bulk actions unaffected) */
#stage-ghost-actions,
#rp-secondary-actions { display: none !important; }
