/* ---------------- RESET & BASE ---------------- */
*{ box-sizing:border-box; }

:root{
  color-scheme: dark;

  --bg: #0f0b16;
  --panelA: rgba(255,255,255,0.07);
  --panelB: rgba(255,255,255,0.045);
  --stroke: rgba(255,255,255,0.10);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);

  --accent: #ff5a3c;

  --shadow: 0 18px 55px rgba(0,0,0,0.45);
  --shadowSoft: 0 14px 30px rgba(0,0,0,0.30);

  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 16px;

  --ease: .15s ease;
}

html, body{
  margin:0;
  padding:0;
  height:100%;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--text);
  display:flex;
  flex-direction:column;

  background:
    radial-gradient(900px 520px at 18% 12%, rgba(255,90,60,0.10), transparent 55%),
    radial-gradient(900px 600px at 82% 18%, rgba(140,90,255,0.10), transparent 60%),
    var(--bg);
}

main{ flex:1; }

a{ color:inherit; text-decoration:none; }
a:hover{ opacity:0.92; }

/* ---------------- BUTTON SYSTEM ---------------- */
button{
  cursor:pointer;
  border:0;
  background:none;
  color:inherit;
  font-family:inherit;
}

:where(button, .btn, .size-btn, .auth-choice-btn, .auth-method-btn, .auth-submit-btn){
  border-radius: var(--r-md);
  transition:
    transform var(--ease),
    background var(--ease),
    border-color var(--ease),
    box-shadow var(--ease),
    filter var(--ease),
    opacity var(--ease);
}

.btn,
.size-btn,
.convert-buttons button,
.auth-choice-btn,
.auth-method-btn{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  box-shadow: none;
}

.btn:hover,
.size-btn:hover,
.convert-buttons button:hover,
.auth-choice-btn:hover,
.auth-method-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}

.btn:active,
.size-btn:active,
.convert-buttons button:active,
.auth-choice-btn:active,
.auth-method-btn:active{
  transform: translateY(0px);
}

.btn:focus-visible,
.size-btn:focus-visible,
.convert-buttons button:focus-visible,
.auth-choice-btn:focus-visible,
.auth-method-btn:focus-visible,
.auth-submit-btn:focus-visible{
  outline: 2px solid rgba(255, 90, 60, 0.9);
  outline-offset: 3px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 16px;
  font-weight:850;
  font-size:14px;
  letter-spacing:0.2px;
}

.btn.primary{
  background: linear-gradient(180deg, rgba(255,90,60,1), rgba(255,90,60,0.85));
  border: 1px solid rgba(255,90,60,0.60);
  color:#fff;
  box-shadow:none;
}
.btn.primary:hover{ filter: brightness(1.03); }

.size-btn.active,
.convert-buttons button.active{
  background: linear-gradient(180deg, rgba(255,90,60,1), rgba(255,90,60,0.85)) !important;
  border-color: rgba(255,90,60,0.60) !important;
  color:#fff !important;
}

/* ---------------- HEADER ---------------- */
.app-header{
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  border-bottom:1px solid rgba(255,255,255,0.08);
  background: rgba(15,11,22,0.65);
  backdrop-filter: blur(10px);

  position:relative;
  z-index:10000;
}

.header-left{
  display:flex;
  align-items:center;
  gap:20px;
  min-width:0;
}

.app-title{
  margin:0;
  font-size:22px;
  white-space:nowrap;
}
.app-title span{
  color: var(--accent);
  font-weight:900;
}



.header-right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* Rank pill */
.rank-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight:900;
  font-size:13px;
  color: var(--text);
}
.rank-icon-top{ font-size:15px; line-height:1; }

/* ---------------- PROFILE ---------------- */
.profile-btn{
  width:36px;
  height:36px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,0.12);
  overflow:hidden;
  background: rgba(255,255,255,0.06);
  box-shadow:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.profile-btn img{ width:100%; height:100%; object-fit:cover; }

.avatar-initial{
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  font-weight:900;
  font-size:18px;
  color:#fff;
}

.profile-menu{
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  width:240px;
  background: rgba(20,14,30,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  display:none;
  z-index:99999;
  color:#fff;
  box-shadow: var(--shadowSoft);
  backdrop-filter: blur(10px);
}

.profile-meta{
  padding:16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.profile-name{ font-size:16px; font-weight:900; }
.profile-email{ font-size:13px; color: rgba(255,255,255,0.75); }

.menu-item,
.profile-menu button{
  width:100%;
  text-align:left;
  background:none;
  border:none;
  padding:12px 16px;
  font-size:14px;
  color:#fff;
  display:flex;
  align-items:center;
  gap:10px;
  border-radius:12px;
  cursor:pointer;
}
.menu-item:hover,
.profile-menu button:hover{ background: rgba(255,255,255,0.06); }
.danger{ color: var(--accent) !important; }

/* ---------------- AUTH ---------------- */
#auth{
  width:100%;
  min-height:100vh;
  background: rgba(20,14,30,0.70);
  display:flex;
  justify-content:center;
  align-items:center;
  padding:40px 20px;
}

.auth-wrapper{
  width:100%;
  max-width:none;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
}

.video-header{
  text-align:center;
  margin:0 0 10px 0;
  font-size:22px;
  font-weight:850;
  color:#fff;
}

#auth .video-row{
  display:grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap:12px !important;
  width: min(1100px, 100%) !important;
  margin: 0 auto 30px !important;
}
#auth .video-row iframe{
  width:100% !important;
  aspect-ratio: 16 / 9 !important;
  border:0 !important;
  border-radius:14px !important;
  display:block !important;
}
@media (max-width:900px){
  #auth .video-row{ grid-template-columns: 1fr !important; }
}

.auth-card{
  max-width:520px;
  width:100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.10);
  padding:28px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadowSoft);
}

.auth-title{
  font-size:22px;
  margin-bottom:20px;
  font-weight:900;
  color:#fff;
}

.auth-choice-btn,
.auth-method-btn{
  width:48%;
  padding:12px;
  font-size:15px;
  font-weight:900;
}

.google-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}

.auth-submit-btn{
  width:100%;
  padding:13px 14px;
  margin-top:14px;
  border-radius:16px;
  background: linear-gradient(180deg, rgba(255,90,60,1), rgba(255,90,60,0.85));
  border: 1px solid rgba(255,90,60,0.60);
  color:#fff;
  font-weight:900;
  font-size:15px;
  letter-spacing:0.3px;
}

.back-btn{
  background:none;
  border:none;
  color: rgba(255,255,255,0.75);
  font-size:14px;
  margin-bottom:8px;
  cursor:pointer;
  width:100%;
  text-align:left;
}
.back-btn:hover{ color: var(--accent); }

/* Inputs: DO NOT style radios/checkboxes here */
input:not([type="range"]):not([type="radio"]):not([type="checkbox"]){
  width:100%;
  padding:10px;
  margin-top:8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius:14px;
  background: rgba(255,255,255,0.04);
  color:#fff;
}

/* ---------------- APP GRID ---------------- */
#app{ padding:22px; }

.app-grid{
  display:grid;
  grid-template-columns: 340px minmax(0, 1fr) 340px;
  gap:18px;
  align-items:start;
}

.panel{
  background: linear-gradient(180deg, var(--panelA), var(--panelB));
  padding:16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadowSoft);
  min-width:0;
}

/* ---------------- LEFT PANEL ---------------- */
.panel-left.theme-modern-left{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.modern-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.modern-title{
  font-size:14px;
  font-weight:900;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color: rgba(255,255,255,0.78);
}
.modern-sub{
  font-size:12px;
  color: rgba(255,255,255,0.70);
}

/* Upload box */
#uploadBox.modern-upload{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border-radius: var(--r-xl);
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  user-select:none;
}
#uploadBox.modern-upload:hover{
  border-color: rgba(255,90,60,0.55);
  background: rgba(255,90,60,0.06);
}
.modern-upload-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  background: rgba(255,90,60,0.14);
  border: 1px solid rgba(255,90,60,0.22);
  display:grid;
  place-items:center;
  font-size:18px;
}
.modern-upload-head{ font-weight:950; }
.modern-upload-hint{ font-size:12px; opacity:0.82; margin-top:2px; }

/* ---------- Styles toggle (tick-in-circle, like screenshot) ---------- */
.style-toggle-row{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:10px;
}

.style-radio{
  display:flex;
  align-items:center;
  cursor:pointer;
  user-select:none;
}

/* hide native radio */
.style-radio input[type="radio"]{
  position:absolute !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:1px !important;
  height:1px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
}

/* label text + custom circle */
.style-radio span{
  position:relative;
  padding-left:34px;
  font-size:18px;
  font-weight:600;
  line-height:1.2;
  color: rgba(255,255,255,0.82);
}

.style-radio span::before{
  content:"";
  position:absolute;
  left:0;
  top:50%;
  transform: translateY(-50%);
  width:20px;
  height:20px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,0.35);
  box-sizing:border-box;
}

.style-radio input[type="radio"]:checked + span{
  color: rgba(255,255,255,0.92);
}

.style-radio input[type="radio"]:checked + span::before{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,90,60,0.16);
}

.style-radio input[type="radio"]:checked + span::after{
  content:"✓";
  position:absolute;
  left:4px;
  top:50%;
  transform: translateY(-55%);
  font-size:14px;
  font-weight:900;
  color: var(--accent);
}

/* Style grid */
.button-row.convert-buttons.modern-style-grid{
  display:grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:8px;
  margin:10px 0 0 0;
}

@media (max-width:430px){
  .button-row.convert-buttons.modern-style-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Scroll for long lists */
.panel-left .button-row.convert-buttons{
  overflow:auto;
  max-height: calc(100vh - 260px);
  padding-right:6px;
}
.panel-left .button-row.convert-buttons::-webkit-scrollbar{ width:10px; }
.panel-left .button-row.convert-buttons::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border-radius:999px;
}

/* Style buttons */
.panel-left .button-row.convert-buttons.modern-style-grid > button{
  appearance:none;
  position:relative;

  width:100%;
  min-height:46px;
  padding:8px 10px;

  border-radius:14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);

  color: rgba(255,255,255,0.92);
  font-weight:900;
  font-size:12px;
  line-height:1.15;
  letter-spacing:0.15px;

  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  /* ✅ don't cut off text */
  white-space: normal;
  word-break: break-word;

  box-shadow:none !important;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}


.panel-left .button-row.convert-buttons.modern-style-grid > button:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}

.panel-left .button-row.convert-buttons.modern-style-grid > button.active{
  background: linear-gradient(180deg, rgba(255,90,60,1), rgba(255,90,60,0.85)) !important;
  border-color: rgba(255,90,60,0.60) !important;
  color:#fff !important;
}

/* NEW/BETA badges */
.panel-left .button-row.convert-buttons.modern-style-grid > button.is-new::before,
.panel-left .button-row.convert-buttons.modern-style-grid > button.is-beta::before{
  position:absolute;
  top:-9px;
  left:50%;
  transform: translateX(-50%);
  z-index:2;
  pointer-events:none;
  white-space:nowrap;

  font-size:10px;
  font-weight:900;
  letter-spacing:0.08em;
  line-height:1;

  padding:3px 8px;
  border-radius:999px;
}

.panel-left .button-row.convert-buttons.modern-style-grid > button.is-new::before{
  content:"NEW!";
  background:#ff5a3c;
  color:#fff;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 12px rgba(255,90,60,0.45);
}

.panel-left .button-row.convert-buttons.modern-style-grid > button.is-beta::before{
  content:"BETA";
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
}

/* Generate button */
#goBtn.modern-generate{
  width:100%;
  border-radius: var(--r-xl);
  padding:12px 16px;
  font-weight:900;
}

/* Mobile note */
.mobile-note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size:13px;
  color: rgba(255,255,255,0.82);
}

/* ---------------- CENTER: BEFORE/AFTER ---------------- */
.image-label{
  margin:0 0 10px 0;
  font-size:14px;
  font-weight:900;
  text-align:center;
}

.compare{
  --ar: 1 / 1;
  position:relative;
  width:100%;
  aspect-ratio: var(--ar);
  max-height:70vh;
  border-radius:22px;
  overflow:hidden;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow);
}

.compare-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
  user-select:none;
  -webkit-user-drag:none;
  background: rgba(0,0,0,0.18);
}

.compare.is-converting .compare-img{
  filter: blur(7px);
  transform: scale(1.01);
  transition: filter .18s ease, transform .18s ease;
}

.compare-badge{
  position:absolute;
  top:10px;
  left:10px;
  padding:6px 10px;
  font-size:12px;
  border-radius:999px;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.10);
  color:#fff;
  z-index:5;
  backdrop-filter: blur(8px);
}

.compare-controls{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  margin-top:10px;
  flex-wrap:wrap;
}
.compare-controls .hint{ font-size:12px; opacity:.82; }

.compare-download-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  margin-top:10px;
  flex-wrap:wrap;
}

.download-label{ font-weight:900; font-size:14px; opacity:0.95; }
.svg-note{
  font-size:12px;
  line-height:1.4;
  opacity:0.8;
  max-width:420px;
}

/* Loading overlay */
.loading-overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.35);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  z-index:20;
}

.converting-text{
  font-weight:950;
  font-size:22px;
  letter-spacing:0.2px;
  padding:12px 16px;
  border-radius:18px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadowSoft);
  display:inline-flex;
  align-items:center;
  gap:6px;
}
#convertingDots{ display:inline-block; min-width:18px; }
.converting-dots::after{
  content:"";
  animation: convertingDots 1.2s steps(4, end) infinite;
}
@keyframes convertingDots{
  0%{ content:""; }
  25%{ content:"."; }
  50%{ content:".."; }
  75%{ content:"..."; }
  100%{ content:""; }
}

/* Warning */
.warning{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding:10px;
  border-radius:16px;
  margin-bottom:10px;
}

/* ---------------- UPDATE TICKER ---------------- */
.update-ticker{
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  overflow: hidden;
  padding: 10px 0;
}

.update-ticker .ticker-track{
  display: inline-flex;
  white-space: nowrap;
  animation: tickerScroll 45s linear infinite;
}

.update-ticker .ticker-item{
  padding: 0 20px;
  font-weight: 850;
  font-size: 13px;
  color: rgba(255,255,255,0.90);
}

/* left-scrolling animation */
@keyframes tickerScroll{
  from { transform: translateX(0%); }
  to   { transform: translateX(-100%); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce){
  .update-ticker .ticker-track{
    animation: none;
    transform: none;
  }
}


/* ---------------- RIGHT PANEL: GALLERY ---------------- */
.panel-right{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
  max-height: calc(100vh - 140px);
  overflow:hidden;
}

#userGallery{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
}
#userGallery h3{
  margin-top:0;
  font-size:18px;
  text-align:center;
  font-weight:950;
}

#openGalleryBtn{
  width:100%;
  justify-content:center;
  border-radius:16px;
}

#galleryGrid{
  flex: 1 1 auto;
  min-height:0;
  overflow:auto;
  padding:10px;
  border-radius:18px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.08);
}

#galleryGrid::-webkit-scrollbar{ width:10px; }
#galleryGrid::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.16);
  border-radius:999px;
  border:2px solid rgba(0,0,0,0.18);
}
#galleryGrid::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.24); }

.gallery-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
  align-items:start;
}

.gallery-thumb{
  position:relative;
  border-radius:16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  box-shadow:none;
  overflow:hidden;
  cursor:pointer;
  transition: transform .16s ease, border-color .16s ease;
}
.gallery-thumb:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.16);
}
.gallery-thumb img{
  width:100%;
  height:120px;
  object-fit:cover;
  object-position:center;
  background: rgba(0,0,0,0.22);
  display:block;
}

.gallery-style-label{
  position:absolute;
  left:10px;
  right:10px;
  bottom:10px;
  padding:8px 10px;
  border-radius:12px;
  background: rgba(0,0,0,0.50);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  font-size:12px;
  font-weight:950;
  text-align:center;
  opacity:0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.gallery-thumb:hover .gallery-style-label{
  opacity:1;
  transform: translateY(0);
}

/* Social promos */
.social-heading{
  margin-top:8px;
  font-size:13px;
  font-weight:950;
  opacity:0.9;
  text-align:center;
}

.facebook-promo,
.youtube-promo{
  margin-top:10px;
  padding:14px 14px;
  border-radius:18px;

  display:flex;
  align-items:center;
  gap:12px;

  text-align:left;
  text-decoration:none;

  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:none;

  transition: transform .18s ease, border-color .18s ease, filter .18s ease;
}

.facebook-promo:hover,
.youtube-promo:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.20);
  filter: brightness(1.04);
}

.facebook-promo img,
.youtube-promo img{
  width:42px;
  height:42px;
  flex-shrink:0;
  display:block;
}

.facebook-promo{
  background:
    linear-gradient(135deg, rgba(24,119,242,0.14), rgba(24,119,242,0.05)),
    rgba(255,255,255,0.04);
}
.youtube-promo{
  background:
    linear-gradient(135deg, rgba(255,0,0,0.12), rgba(255,0,0,0.04)),
    rgba(255,255,255,0.04);
}

.facebook-promo span,
.youtube-promo span{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-weight:950;
}
.facebook-promo span::after{
  content:"Join other creators & share your art";
  font-size:12px;
  font-weight:650;
  opacity:0.85;
}
.youtube-promo span::after{
  content:"Watch tutorials & transformations";
  font-size:12px;
  font-weight:650;
  opacity:0.85;
}

/* ---------------- MODALS ---------------- */
.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.65);
  display:none;
  align-items:flex-start;
  justify-content:center;
  z-index:9999;
  padding:18px;
}

.modal{
  width: min(980px, 100%);
  max-height:88vh;
  background: rgba(20,14,30,0.92);
  border-radius: var(--r-xl);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  backdrop-filter: blur(10px);
}

.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  background: rgba(255,255,255,.04);
}
.modal-title{ font-weight:900; }
.modal-close{
  background:transparent;
  border:0;
  color:#fff;
  font-size:22px;
  cursor:pointer;
  line-height:1;
  padding:0 6px;
}

.modal-body{
  flex:1;
  min-height:0;
  background: rgba(0,0,0,0.22);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.modal-footer{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:12px 14px;
  background: rgba(255,255,255,.04);
}

/* Crop */
#cropImg{ max-width:100%; max-height:70vh; display:block; }
.crop-header{ gap:12px; }
.crop-header-left{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.crop-size-row{
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
#cropModal .size-btn{
  padding:8px 10px;
  font-size:12px;
  font-weight:950;
  border-radius:999px;
}

/* Gallery modal */
#galleryModal{ z-index:10050; }

.modal-gallery{
  width: min(1100px, 92vw);
  max-height:88vh;
  display:flex;
  flex-direction:column;
}

.modal-body-gallery{
  position:relative;
  padding:14px;
  background: rgba(0,0,0,0.22);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.gallery-image-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
}

.gallery-modal-img{
  display:block;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height: calc(88vh - 120px) !important;
  object-fit:contain !important;
  object-position:center center !important;
  border-radius:14px;
  background: rgba(0,0,0,0.18);
  transform:none !important;
}

.gallery-arrow{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:44px;
  height:44px;
  border-radius:14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.10);
  color:#fff;
  cursor:pointer;
  display:grid;
  place-items:center;
  z-index:3;
  user-select:none;
}
#galleryPrevBtn{ left:14px; }
#galleryNextBtn{ right:14px; }

.modal-footer-gallery{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background: rgba(255,255,255,.04);
}

/* Full Gallery Grid modal */
#galleryGridModal{ z-index:10060; }
#galleryGridModal.modal-backdrop{
  align-items:flex-start;
  overflow-y:auto;
  padding-top:18px;
  padding-bottom:18px;
}

#galleryGridModal .modal.modal-gallery-grid{
  width: min(1200px, 96vw);
  max-height: calc(100vh - 36px);
  display:flex;
  flex-direction:column;
  margin:0 auto;
}

#galleryGridModal .modal-body-gallery-grid{
  padding:20px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  flex:1;
  display:flex;
  justify-content:center;
}

#fullGalleryGrid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:14px;
  align-items:start;
  width: min(1100px, 100%);
}

.full-gallery-item{
  width:100%;
  border:0;
  padding:0;
  background:transparent;
  cursor:pointer;
  display:block;
  max-width:220px;
}

.full-gallery-item img{
  width:100%;
  height:140px;
  object-fit:cover;
  display:block;
  border-radius:14px;
}

.full-gallery-caption{
  margin-top:6px;
  font-size:12px;
  opacity:0.9;
  text-align:center;
}

/* ---------------- FOOTER ---------------- */
footer{
  border-top:1px solid rgba(255,255,255,0.08);
  padding:18px 20px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  background: rgba(15,11,22,0.55);
  backdrop-filter: blur(10px);
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width:900px){
  .app-grid{ grid-template-columns: 1fr; }
  #fullGalleryGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .full-gallery-item img{ height:160px; }
  .svg-note{ max-width:100%; text-align:center; }
}

/* Header brand (logo + text) */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px; /* matches your rounded style */
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.brand-accent {
  opacity: 0.95;
}

.brand-tagline {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 3px;
}

/* Keep nav aligned nicely next to the logo */
.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Optional: hide tagline on small screens */
@media (max-width: 600px) {
  .brand-tagline {
    display: none;
  }
  .brand-name {
    font-size: 18px;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
}
