:root {
  --bg: #ffffff;
  --alt: #F4F6F5;
  --text: #15171A;
  --text2: #3D434B;
  --accent: #0B6B52;
  --accent-h: #084C3B;
  --tint: #DCEFE8;
  --border: #E7E9EC;
  --danger-bg: #FDECEC;
  --danger: #8A1C1C;
  --r: 16px;
  --r-sm: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Inter, 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] button, html[lang="ar"] input, html[lang="ar"] select, html[lang="ar"] textarea {
  font-family: 'IBM Plex Sans Arabic', Inter, sans-serif;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', Inter, 'IBM Plex Sans Arabic', sans-serif;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--text2); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, label:focus-visible {
  outline: 3px solid var(--tint);
  outline-offset: 2px;
}
.hint { font-size: 0.875rem; color: var(--text2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section.alt { background: var(--alt); }
.section-head { margin-bottom: 36px; max-width: 640px; }
.section-head p { font-size: 1.05rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: 'Space Grotesk', Inter, 'IBM Plex Sans Arabic', sans-serif; font-weight: 700; font-size: 1.1rem; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%229.24%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221.3%22%20stroke-opacity%3D%220.3%22/%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%225.69%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221.3%22%20stroke-opacity%3D%220.6%22/%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%222.6%22%20fill%3D%22%23fff%22/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--text2); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang {
  min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: #fff; padding: 6px 10px; font: inherit; color: var(--text2);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r-sm);
  border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Cards and forms */
.card { border: 1px solid var(--border); border-radius: var(--r); padding: 24px; background: #fff; }
.card h3 { margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.input {
  min-height: 44px; width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px; font: inherit; color: var(--text); background: #fff;
}
.input:focus { border-color: var(--accent); }
.badge {
  display: inline-block; background: var(--tint); color: var(--accent-h);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 0.92rem; white-space: nowrap;
}
.alert {
  padding: 12px 14px; border-radius: var(--r-sm); background: var(--danger-bg);
  color: var(--danger); margin: 12px 0; font-size: 0.95rem;
}
.alert.ok { background: var(--tint); color: var(--accent-h); }

/* Tabs */
.tabs { display: flex; gap: 8px; background: var(--alt); padding: 6px; border-radius: var(--r-sm); margin-bottom: 20px; }
.tab {
  flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent;
  font: inherit; font-weight: 600; color: var(--text2); cursor: pointer;
}
.tab[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 64px 20px 72px; }
.ar-line { font-size: 1.2rem; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.lead { font-size: 1.12rem; max-width: 520px; }
.ba svg { width: 100%; height: auto; display: block; }

/* Steps, styles, pricing */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step-num {
  width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--accent-h);
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px;
}
.ph {
  aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--alt);
  border: 1px dashed #C9D3CE; display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 0.9rem; margin-bottom: 14px;
}
.price { font-family: 'Space Grotesk', Inter, 'IBM Plex Sans Arabic', sans-serif; font-size: 2rem; font-weight: 700; color: var(--text); margin: 6px 0 2px; }
.price small { font-size: 1rem; font-weight: 500; color: var(--text2); }
.pack-featured { border: 2px solid var(--accent); position: relative; }
.tag {
  position: absolute; top: -12px; left: 20px; background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}
.pack-card { display: flex; flex-direction: column; }
.pack-card .btn { margin-top: auto; }
.note { margin-top: 28px; }
details { border-bottom: 1px solid var(--border); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; min-height: 44px; display: flex; align-items: center; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; margin-inline-start: auto; font-size: 1.4rem; color: var(--accent); }
details[open] > summary::after { content: "\2212"; }
details p { margin-top: 8px; }

/* Dark CTA and footer */
.dark { background: #15171A; color: #fff; }
.dark h2 { color: #fff; }
.dark .btn-primary { background: #fff; color: var(--text); }
.dark .btn-primary:hover { background: var(--tint); }
.footer { padding: 28px 0; border-top: 1px solid var(--border); color: var(--text2); font-size: 0.92rem; text-align: center; }

/* App pages */
.page-top { padding: 40px 0 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; padding-bottom: 60px; }
.drop {
  display: flex; align-items: center; justify-content: center; min-height: 220px;
  border: 2px dashed #C9D3CE; border-radius: var(--r); padding: 20px; text-align: center;
  cursor: pointer; background: #fff; margin: 12px 0 24px; position: relative; overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--tint); }
.drop p { margin-bottom: 4px; }
.drop img { max-height: 280px; max-width: 100%; border-radius: var(--r-sm); }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 20px; }
.style-opt {
  min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff;
  padding: 12px 10px; text-align: start; font: inherit; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.style-opt small { color: var(--text2); font-size: 0.8rem; line-height: 1.35; }
.style-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gen { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.gen img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--alt); }
.gen .gen-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.gen .gen-body span { font-size: 0.9rem; color: var(--text2); }
/* Size picker */
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 20px; }
.size-opt {
  min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff;
  padding: 12px 10px; text-align: start; font: inherit; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.size-opt small { color: var(--text2); font-size: 0.8rem; line-height: 1.35; }
.size-opt .shape { width: 28px; height: 28px; color: var(--accent); flex: none; }
.size-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }

/* Before / after slider */
.compare {
  position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; direction: ltr;
  background: var(--alt); border-radius: var(--r-sm); user-select: none; touch-action: pan-y; cursor: ew-resize;
}
.compare-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  display: block; pointer-events: none; -webkit-user-drag: none;
}
.compare-line {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(21, 23, 26, 0.25); pointer-events: none;
}
.compare-handle {
  position: absolute; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(21, 23, 26, 0.25);
  display: flex; align-items: center; justify-content: center; cursor: ew-resize;
}
.compare-label {
  position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(21, 23, 26, 0.7); color: #fff; font-size: 0.8rem; font-weight: 600;
  line-height: 1.3; pointer-events: none;
}
.compare-label-before { left: 10px; }
.compare-label-after { right: 10px; }
.compare-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.compare-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(22px); transform: scale(1.15); pointer-events: none; -webkit-user-drag: none; }

.gen .compare-img { position: absolute; aspect-ratio: auto; object-fit: contain; background: transparent; }
.gen .gen-body .size-badge { font-size: 0.8rem; padding: 4px 10px; align-self: flex-start; color: var(--accent-h); }

.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }

/* Stats and tables */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 32px; }
.stat strong { display: block; font-family: 'Space Grotesk', Inter, 'IBM Plex Sans Arabic', sans-serif; font-size: 2rem; color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.table th { color: var(--text2); font-weight: 600; font-size: 0.85rem; background: var(--alt); }
.table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.pill.pending { background: #FFF4DB; color: #7A5300; }
.pill.approved { background: var(--tint); color: var(--accent-h); }
.pill.rejected { background: var(--danger-bg); color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-approve { background: var(--accent); color: #fff; min-height: 44px; padding: 8px 14px; border: 0; border-radius: var(--r-sm); font: inherit; font-weight: 600; cursor: pointer; }
.btn-reject { background: #fff; color: var(--danger); min-height: 44px; padding: 8px 14px; border: 1px solid #E8B4B4; border-radius: var(--r-sm); font: inherit; font-weight: 600; cursor: pointer; }

/* Packs and methods on buy page */
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.option {
  display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 16px; cursor: pointer; background: #fff; min-height: 44px;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.option strong { font-family: 'Space Grotesk', Inter, 'IBM Plex Sans Arabic', sans-serif; font-size: 1.15rem; }
.option span { color: var(--text2); font-size: 0.95rem; }
.pay-box { background: var(--alt); border-radius: var(--r-sm); padding: 16px 18px; margin-bottom: 24px; }
.pay-box p { margin-bottom: 6px; }
.section-title { font-size: 1.1rem; margin: 24px 0 12px; }

/* Responsive */
@media (max-width: 900px) {
  .app-grid { grid-template-columns: 1fr; }
  .styles { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 40px 20px 48px; gap: 28px; }
  .grid-3, .grid-4, .option-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .section { padding: 52px 0; }
  .nav-right .btn { padding: 8px 12px; }
}

/* Mode tabs, prompt templates and custom prompt */
.mode-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.mode-opt {
  min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.mode-opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.tpl-opt {
  display: flex; flex-direction: column; gap: 6px; text-align: start; min-height: 44px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff;
  color: var(--text); font: inherit; cursor: pointer;
}
.tpl-opt span { font-weight: 600; }
.tpl-opt small {
  color: var(--text2); font-size: 0.8rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tpl-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.prompt-box { width: 100%; resize: vertical; min-height: 120px; line-height: 1.5; font: inherit; }
.prompt-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }

/* ---------- Studio upgrades ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.drop-line { display: block; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 8px; }
.thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--alt); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-rm {
  position: absolute; top: 4px; inset-inline-end: 4px; width: 32px; height: 32px; border-radius: 999px;
  border: 0; background: rgba(21, 23, 26, 0.75); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.row-btns .input { flex: 1 1 180px; min-width: 0; }
.field-label { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; align-self: flex-start; }
.seg-opt {
  min-width: 52px; min-height: 44px; border: 0; border-inline-end: 1px solid var(--border);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.seg-opt:last-child { border-inline-end: 0; }
.seg-opt[aria-pressed="true"] { background: var(--accent); color: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check > span { display: flex; flex-direction: column; gap: 2px; }
.check strong { font-weight: 600; font-size: 0.95rem; }
.check.inline { margin: 0; align-items: center; }
.check input:disabled + span { opacity: 0.6; }
.presets-box { border-top: 1px solid var(--border); padding-top: 14px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.chip-use { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text); padding: 10px 6px 10px 14px; min-height: 44px; cursor: pointer; }
[dir="rtl"] .chip-use { padding: 10px 14px 10px 6px; }
.chip-del { border: 0; background: transparent; color: var(--text2); width: 40px; min-height: 44px; display: grid; place-items: center; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.progress { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; background: var(--alt); }
.progress-batch { font-weight: 600; margin: 0 0 8px; color: var(--text); }
.steps { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; color: #6B7178; }
.steps li .dot { width: 12px; height: 12px; border-radius: 999px; border: 2px solid #9AA0A6; flex: none; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active .dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.steps li.done { color: var(--accent-h); }
.steps li.done .dot { background: var(--accent); border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps li.active .dot { animation: none; background: var(--tint); } }
.cost { text-align: center; margin: 8px 0 0; }
.brand-card summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.brand-card summary::-webkit-details-marker { display: none; }
.brand-card summary::after { content: '+'; font-size: 1.4rem; color: var(--text2); }
.brand-card[open] > summary::after { content: '\2212'; }
.brand-body { margin-top: 16px; }
input[type="color"] { width: 52px; height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 4px; background: #fff; cursor: pointer; }
.logo-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.logo-row img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: var(--alt); }
.gen-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gen .gen-body .kind-badge { font-size: 0.8rem; padding: 4px 10px; background: #FFF3DC; color: #6B4A12; }
.gen-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.gen-actions .btn { flex: 1 1 auto; }
.edit-box { display: flex; flex-direction: column; gap: 6px; }
.edit-box[hidden] { display: none; }

.drop { min-height: 140px; margin-bottom: 8px; }

/* ---------- Brand kit (simpler) ---------- */
.brand-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge-ok { background: var(--tint); color: var(--accent-h); }
.badge-muted { background: var(--alt); color: var(--text2); }
.link-btn {
  background: none; border: 0; padding: 8px 0; min-height: 44px; margin: -10px 0 10px 30px;
  color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}
[dir="rtl"] .link-btn { margin: -10px 30px 10px 0; }
.brand-grid { display: grid; grid-template-columns: 1fr 200px; gap: 20px; align-items: start; margin: 12px 0 16px; }
.brand-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.brand-form .field-label { margin-top: 8px; }
.logo-drop {
  display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 12px;
  border: 2px dashed #C9D3CE; border-radius: 12px; background: #fff; cursor: pointer; text-align: center;
}
.logo-drop:hover, .logo-drop.over, .logo-drop:focus-visible { border-color: var(--accent); background: var(--tint); outline: none; }
.drop:focus-visible { border-color: var(--accent); background: var(--tint); outline: none; }
.logo-drop img { max-height: 96px; max-width: 100%; object-fit: contain; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--accent-h); font-weight: 600; }
#removeLogo { align-self: flex-start; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.pair {
  position: relative; display: inline-flex; align-items: center; gap: 0; padding: 4px; min-height: 44px; min-width: 64px;
  border: 2px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit;
}
.pair > span { width: 26px; height: 32px; display: block; }
.pair > span:first-child { border-radius: 8px 0 0 8px; }
.pair > span:nth-child(2) { border-radius: 0 8px 8px 0; border: 1px solid rgba(0,0,0,0.06); }
.pair-logo { display: inline-grid; grid-template-columns: 26px 26px; grid-template-rows: 32px auto; padding: 4px 6px; }
.pair-logo > span { display: block; }
.pair-logo small { grid-column: 1 / -1; font-size: 0.72rem; color: var(--accent-h); font-weight: 600; }
.pair-none { padding: 4px 12px; color: var(--text2); font-weight: 600; font-size: 0.85rem; }
.pair[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--tint); }
.custom-colors { margin-top: 4px; }
.brand-preview-wrap { display: flex; flex-direction: column; gap: 8px; }
.brand-preview {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
.bp-product {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: 34%; height: 46%; border-radius: 12px 12px 8px 8px; background: #fff; box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}
.bp-logo { position: absolute; top: 8px; right: 8px; width: 28%; max-height: 22%; object-fit: contain; }
.bp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; color: #fff; font-weight: 700; font-size: 0.9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: center;
}
@media (max-width: 760px) {
  .brand-grid { grid-template-columns: 1fr; }
  .brand-preview-wrap { max-width: 220px; }
}

/* ---------- Studio page redesign (phone first, one column) ---------- */
.studio { max-width: 760px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 20px; }
.studio-title { font-size: 1.7rem; margin: 28px 0 0; }
.studio .card { padding: 20px; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px;
  background: var(--tint); color: var(--accent-h); font-weight: 600; font-size: 0.9rem; text-decoration: none; white-space: nowrap;
}
.credit-pill:hover { background: #CDE8DE; }
.pill-sep { width: 1px; height: 18px; background: rgba(8, 76, 59, 0.25); margin: 0 4px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.icon-btn { width: 44px; padding: 0; display: inline-grid; place-items: center; }
.menu-pop {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 30; width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  box-shadow: 0 12px 32px rgba(21, 23, 26, 0.14); display: flex; flex-direction: column; gap: 6px;
}
.menu-pop .lang { width: 100%; }
.menu-label { font-weight: 600; font-size: 0.85rem; }
.menu-retries { margin: 6px 0 2px; }
.menu-item { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.menu-item:hover { background: var(--alt); color: var(--accent); }
.menu-item[hidden] { display: none; }
.step-h { display: flex; align-items: center; gap: 8px; }
.step-check { width: 24px; height: 24px; border-radius: 999px; border: 2px solid #C9D3CE; display: inline-grid; place-items: center; flex: none; color: #fff; }
.step-check.done { background: var(--accent); border-color: var(--accent); }
.upload-box {
  border: 2px dashed #C9D3CE; border-radius: var(--r); padding: 16px; background: #fff; margin: 4px 0 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.upload-box.over { border-color: var(--accent); background: var(--tint); }
.upload-box .thumbs { margin: 0; }
.upload-box .thumbs:empty { display: none; }
.upload-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-btns .btn { gap: 8px; min-height: 52px; }
.upload-hint { margin: 0; text-align: center; }
.styles { grid-template-columns: repeat(4, 1fr); }
.style-opt { padding: 8px; align-items: stretch; text-align: center; }
.style-name { font-weight: 600; font-size: 0.95rem; }
.art { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; }
.art i { position: absolute; left: 50%; top: 52%; width: 30%; height: 46%; transform: translate(-50%, -50%); border-radius: 8px 8px 6px 6px; }
.art-studio { background: #F4F4F2; }
.art-studio i { background: #2E6B57; box-shadow: 0 10px 12px -6px rgba(0,0,0,0.25); }
.art-luxury { background: #17181C; }
.art-luxury i { background: #D9B566; box-shadow: 0 0 22px rgba(217, 181, 102, 0.45); }
.art-outdoor { background: #9CC3E6; }
.art-outdoor::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: #6E9F5B; }
.art-outdoor i { background: #FFFFFF; z-index: 1; top: 55%; }
.art-ad { background: #F2B544; }
.art-ad i { background: #FFFFFF; left: 34%; }
.art-ad b { position: absolute; right: 8%; top: 30%; font-size: 0.95rem; font-weight: 800; color: #15171A; direction: ltr; }
.tpl-opt { flex-direction: row; align-items: flex-start; gap: 10px; }
.tpl-opt > span:not(.tpl-art), .tpl-opt small { display: block; }
.tpl-opt { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; }
.tpl-art { grid-row: 1 / span 2; position: relative; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; }
.tpl-art i { position: absolute; left: 50%; top: 52%; width: 34%; height: 50%; transform: translate(-50%, -50%); border-radius: 6px; }
.more { border: 1px solid var(--border); border-radius: 14px; margin: 8px 0 4px; background: #fff; }
.more > summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 10px 16px; display: flex; flex-direction: column; justify-content: center; gap: 2px; position: relative;
  padding-inline-end: 44px;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: '+'; position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--text2); }
.more[open] > summary::after { content: '\2212'; }
.more-title { font-weight: 700; }
.more-sum { font-size: 0.85rem; }
.more-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.more-body .field:first-child { margin-top: 14px; }
.more .brand-card { border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px; margin: 0 0 16px; }
.more .brand-card[open] { padding-bottom: 14px; }
.results { scroll-margin-top: 80px; }
.results .gallery { grid-template-columns: 1fr; }
.results .progress { margin-bottom: 16px; }
.create-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(21, 23, 26, 0.08);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.create-bar-in { max-width: 760px; display: flex; align-items: center; gap: 12px; }
.create-bar .btn { flex: 1; min-height: 52px; font-size: 1.05rem; }
.create-bar #cost { white-space: nowrap; }
@media (min-width: 640px) { .results .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .styles { grid-template-columns: repeat(2, 1fr); }
  .sizes { gap: 8px; }
  .size-opt small { display: none; }
  .studio-title { font-size: 1.4rem; margin-top: 20px; }
  .credit-pill { padding: 6px 10px; }
  .site-header .logo span:last-child { font-size: 1rem; white-space: nowrap; }
  .upload-btns { grid-template-columns: 1fr; }
}

.menu > summary::after { content: none; }
.menu > summary.icon-btn { display: inline-grid; min-height: 44px; height: 44px; }
.tpl-opt small { display: -webkit-box; -webkit-line-clamp: 2; }
.tpl-opt[aria-pressed="true"] small { -webkit-line-clamp: unset; }
.more > summary { align-items: flex-start; text-align: start; }

/* ---------- Describe-first step ---------- */
.step-h label { cursor: pointer; }
.prompt-main { margin-bottom: 8px; }
.prompt-main .prompt-box { min-height: 88px; font-size: 1rem; }
.ideas { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.idea-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.idea {
  flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 6px 14px 6px 6px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; white-space: nowrap;
}
[dir="rtl"] .idea { padding: 6px 6px 6px 14px; }
.idea .tpl-art { width: 36px; height: 36px; border-radius: 999px; grid-row: auto; }
.idea[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.idea:hover { border-color: var(--accent); }
.menu { border: 0; padding: 0; }
#promptCount { white-space: nowrap; }
.more { padding: 0; }
.more .brand-card { border-bottom: 1px solid var(--border); }
.gen-single { position: relative; width: 100%; background: var(--alt); border-radius: var(--r-sm); overflow: hidden; }
.gen .gen-single img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; display: block; }
.upload-hint.no-photo { color: var(--accent-h); font-weight: 600; }
.thumbs:not(:empty) ~ .upload-hint.no-photo { display: none; }

/* ---------- UX pass: tabs, credit pill, share, auth gate ---------- */
/* Signed-in pages stay hidden until the account is checked, so logged-out visitors see no flash. */
.auth-wait main, .auth-wait .create-bar, .auth-wait .nav-right { visibility: hidden; }
.credit-pill { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.15; padding: 5px 14px; }
.credit-pill strong { font-size: 0.92rem; }
.credit-pill small { font-size: 0.74rem; font-weight: 500; opacity: 0.85; }
.credit-pill.empty { background: #FDEBD3; color: #8A4B00; }
.studio-tabs { margin: 0; position: sticky; top: calc(var(--hdr, 69px) + 8px); z-index: 5; box-shadow: 0 -8px 0 8px var(--bg, #fff), 0 0 0 8px var(--bg, #fff); }
.studio-tabs .tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.tab-count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.75rem; padding: 1px 8px; font-weight: 700; }
.tab-count[hidden] { display: none; }
.step-h .badge { font-size: 0.72rem; padding: 2px 8px; font-weight: 600; }
.prompt-tools { justify-content: flex-start; }
.prompt-count { margin-inline-start: auto; }
.prompt-hint { margin: 6px 0 0; }
.ideas { margin: 0 0 10px; }
.empty-res { text-align: center; padding: 28px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-res[hidden] { display: none; }
.gen-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gen-actions .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.create-bar[hidden] { display: none; }
.option-popular { position: relative; }
.pack-badge {
  position: absolute; top: -11px; inset-inline-end: 14px; background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 76px; }
.pw-toggle {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px;
  border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px;
}
.pw-toggle:hover { background: var(--tint); }
.gen .gen-actions span { color: inherit; font-size: inherit; }
.option .pack-badge { color: #fff; }
.alert.info { background: #FDF3E3; color: #6B4A12; }
.alert.info a { color: inherit; font-weight: 700; margin-inline-start: 4px; }
/* Mode switch: product photo / create anything */
.mode-switch { display: flex; width: 100%; margin-bottom: 18px; }
.mode-switch .seg-opt { flex: 1; min-height: 44px; font-weight: 600; }
.mode-free .product-only { display: none !important; }
/* Onboarding: business or personal */
.onboard { max-width: 560px; padding-top: 40px; padding-bottom: 72px; }
.onboard h1 { font-size: 1.9rem; margin: 0 0 8px; }
.onboard-sub { margin: 0 0 24px; color: var(--text2); }
.onboard-choices { display: flex; flex-direction: column; gap: 14px; }
.onboard-card {
  display: flex; align-items: flex-start; gap: 16px; text-align: start; width: 100%;
  padding: 20px; border: 2px solid var(--border); border-radius: var(--r); background: #fff;
  font: inherit; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s;
}
.onboard-card:hover, .onboard-card:focus-visible { border-color: var(--accent); background: var(--tint); outline: none; }
.onboard-card.current { border-color: var(--accent); }
.onboard-card:disabled { opacity: .6; cursor: wait; }
.onboard-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--tint); color: var(--accent-h); }
.onboard-text { display: flex; flex-direction: column; gap: 4px; }
.onboard-text strong { font-size: 1.15rem; }
.onboard-text span { color: var(--text2); line-height: 1.45; }
.onboard-note { text-align: center; margin-top: 18px; }
#createPanel > div:first-child > .section-title:first-child { margin-top: 0; }

/* Signed-in pages wait for the login check before showing (no flash for logged-out visitors).
   Show a small loading mark meanwhile, and reveal the page after 3 s even if a script is slow
   or blocked, so it is never left blank. */
.auth-wait main, .auth-wait .create-bar, .auth-wait .nav-right { animation: auth-reveal 0s 3s forwards; }
@keyframes auth-reveal { to { visibility: visible; } }
.auth-wait::after {
  content: ""; position: fixed; left: 50%; top: 45%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 999px; border: 3px solid var(--tint); border-top-color: var(--accent);
  animation: auth-spin .8s linear infinite, auth-hide 0s 3s forwards;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-hide { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .auth-wait::after { animation: auth-hide 0s 3s forwards; } }
/* Picture still downloading, or failed: overlay on the card's image */
.pic-wait, .pic-failed { position: relative; }
.pic-status {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 0; background: #F1F3F2; color: var(--text2); font: inherit; font-weight: 600; z-index: 3;
}
.pic-wait .pic-status, .pic-failed .pic-status { display: flex; }
.pic-wait .pic-status::before {
  content: ""; width: 30px; height: 30px; border-radius: 999px; border: 3px solid var(--tint); border-top-color: var(--accent);
  animation: auth-spin .8s linear infinite;
}
.pic-failed .pic-status { cursor: pointer; color: var(--accent-h); }
.pic-failed .pic-status::before { content: "\21BB"; font-size: 1.6rem; animation: none; border: 0; width: auto; height: auto; }

/* ---------- Personal studio: prompt first, everything on one screen ---------- */
/* Bottom bar: solid, so nothing shows through behind the cost and button */
.create-bar { background: #fff; }
/* Not ready yet: the button stays tappable and full colour; the bar says what is missing. */
.create-bar #cost.cost-need { color: var(--accent-h); font-weight: 600; white-space: normal; line-height: 1.3; font-size: 0.85rem; flex: 1 1 0; min-width: 0; }
.create-bar .btn { white-space: nowrap; }
.create-bar #cost.cost-need + .btn { flex: 0 0 auto; padding-inline: 22px; }
.prompt-need { margin: 8px 0 0; color: var(--accent-h); background: var(--tint); border-radius: var(--r-sm); padding: 8px 12px; font-size: 0.92rem; font-weight: 600; }
.prompt-box.nudge { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
@media (prefers-reduced-motion: no-preference) {
  .prompt-box.nudge { animation: nudge .45s ease; }
}
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Prompt box with the Improve button inside */
.prompt-wrap { position: relative; }
.prompt-box { resize: none; }
.prompt-wrap .prompt-box { padding-bottom: 52px; }
.improve-in {
  position: absolute; inset-inline-end: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff;
  color: var(--accent-h); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.improve-in:hover { border-color: var(--accent); background: var(--tint); }
.improve-in:disabled { opacity: .6; cursor: wait; }
.prompt-tools:not(:has(:not([hidden]))) { display: none; }
#promptCount[hidden] { display: none; }

/* Idea row: swipeable, no scrollbar, fades out at the end */
.idea-row { scrollbar-width: none; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 36px); mask-image: linear-gradient(to left, transparent 0, #000 36px); padding-inline-end: 28px; }
[dir="rtl"] .idea-row { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 36px); mask-image: linear-gradient(to right, transparent 0, #000 36px); }
.idea-row::-webkit-scrollbar { display: none; }

/* Idea cards with real pictures */
.idea-cards { gap: 10px; }
.idea-card {
  flex: none; width: 96px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 0;
  border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: center;
}
.idea-thumb { display: block; width: 96px; height: 96px; border-radius: 16px; overflow: hidden; background: var(--alt); border: 2px solid transparent; }
.idea-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idea-thumb-icon { display: grid; place-items: center; background: var(--tint); color: var(--accent-h); }
.idea-name { font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.idea-card[aria-pressed="true"] .idea-thumb, .idea-card:hover .idea-thumb { border-color: var(--accent); }

/* Size and versions as small pills */
.personal-only { display: none !important; }
.mode-free .personal-only { display: flex !important; }
.quick-opts { flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 2px 0 16px; }
.qp-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.qp {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.qp svg { color: var(--accent); }
.qp[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); color: var(--accent-h); }
.qp-count { min-width: 44px; justify-content: center; padding: 0 10px; }

/* Order inside the personal card: prompt, options, ideas, then optional images */
#promptSection { display: flex; flex-direction: column; }
.mode-free #promptSection > .step-h { display: none; }
.mode-free #promptSection .prompt-main { order: 1; }
.mode-free #promptSection .quick-opts { order: 2; }
.mode-free #promptSection .ideas { order: 3; }
.mode-free .prompt-main .prompt-box { min-height: 150px; font-size: 1.05rem; }
.mode-free .prompt-hint { display: none; }

/* Optional images: compact, and not competing with Generate */
.mode-free #upSection .section-title { font-size: 1rem; margin-top: 18px; }
.mode-free .upload-box { border-style: solid; padding: 12px; gap: 8px; }
.mode-free .upload-btns { grid-template-columns: 1fr 1fr; }
.mode-free .upload-btns .btn { min-height: 44px; font-size: 0.9rem; }
.mode-free #camBtn { background: #fff; color: var(--text); border: 1px solid var(--border); }

/* Personal header and title: just the credits, less space before the prompt */
.studio-personal #freeRetries { display: none; }
.studio-personal .studio-title { font-size: 1.3rem; margin-top: 16px; }
.studio-personal .studio-tabs .tab { min-height: 40px; }
/* Personal studio: ideas and images tucked into "More options" */
.adv-more { margin-top: 4px; flex-direction: column; }
.adv-more .ideas { margin: 0 0 6px; }
.adv-more #upSection .section-title { margin-top: 14px; }
.mode-free details.adv-more { display: block !important; }

/* ---------- Admin (phone first) ---------- */
.admin { max-width: 1000px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.admin-title { font-size: 1.6rem; margin: 0; }
#refreshBtn svg { transition: transform .6s; }
#refreshBtn.spin svg { animation: admin-spin .8s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }
.admin-h2 { font-size: 1.08rem; margin: 0; }
.admin-sub { margin: 26px 0 0; }
.admin-note { margin: 4px 0 0; }

/* Tabs: a bottom bar on phones (thumb reach, all five visible), pills under the title on wider screens */
.admin-tabs {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
  border-top: 1px solid var(--border); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.admin-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; padding: 4px 2px; border: 0; border-radius: 12px; background: transparent; font: inherit;
  font-weight: 600; font-size: .7rem; line-height: 1.1; color: var(--text2); cursor: pointer; min-width: 0;
}
.tab-ico { width: 22px; height: 22px; }
.admin-tab[aria-selected="true"] { color: var(--accent-h); }
.admin-tab[aria-selected="true"] .tab-ico { background: var(--tint); border-radius: 999px; padding: 2px 12px; width: 48px; box-sizing: border-box; height: 26px; }
.admin-tab .tab-count { position: absolute; top: 2px; left: calc(50% + 8px); font-size: .65rem; padding: 0 6px; line-height: 1.5; }
.tab-warn { background: #C4320A; }
/* Overview */
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.admin-stats .stat {
  display: flex; flex-direction: column; gap: 0; padding: 10px 12px; text-align: start; font: inherit;
  cursor: pointer; border-radius: var(--r-sm); min-width: 0;
}
.admin-stats .stat:hover { border-color: var(--accent); }
.stat-label { font-size: .8rem; color: var(--text2); }
.admin-stats .stat strong { font-size: 1.3rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-stats .stat small { font-size: .76rem; color: var(--text2); }
.admin-attention { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.attn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; text-align: start;
  border: 1px solid #F3C57C; background: #FFF8EC; border-radius: var(--r-sm); font: inherit; color: #6A4300; cursor: pointer;
}
.attn-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #DC8A14; color: #fff; font-weight: 700; font-size: .8rem; }
.attn > span:nth-child(2) { flex: 1; font-weight: 600; font-size: .92rem; }
.attn-cta { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.admin-card { padding: 14px; margin-bottom: 12px; border-radius: var(--r-sm); }
.admin-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.a-seg { display: inline-flex; background: var(--alt); border-radius: 10px; padding: 3px; }
.a-seg button { border: 0; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; color: var(--text2); padding: 0 10px; min-height: 34px; border-radius: 8px; cursor: pointer; }
.a-seg button[aria-checked="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chart-readout { margin: 8px 0 2px; min-height: 1.6em; color: var(--text); }
.chart { position: relative; width: 100%; overflow: hidden; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--text); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.chart svg { display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .base { stroke: #C9CDD2; stroke-width: 1; }
.chart path { fill: #0E8A66; transition: opacity .15s; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar:focus { outline: none; }
.chart .bar.on path, .chart .bar:focus path { fill: #0B6B52; }
.chart .bar.on .hit, .chart .bar:focus-visible .hit { fill: rgba(11,107,82,.07); }
.chart .val { font-size: 11px; font-weight: 600; fill: var(--text); }
.chart .tick { font-size: 11px; fill: var(--text2); }
.chart-table { border: 0; padding: 0; }
.chart-table summary::after { content: none; }
.chart-table summary { cursor: pointer; font-weight: 500; font-size: .85rem; color: var(--text2); margin-top: 6px; min-height: 32px; display: flex; align-items: center; }
.chart-table .table { font-size: .85rem; margin-top: 6px; }
.chart-table .table td, .chart-table .table th { padding: 6px 10px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0 8px; }
.kv div { min-width: 0; }
.kv dt { font-size: .8rem; color: var(--text2); }
.kv dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
.kv dd .hint { font-weight: 500; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.admin-card h2 + .tool-row { border-top: 0; }
.tool-row > div { display: flex; flex-direction: column; min-width: 0; }
.tool-row .btn { flex: none; }
.svc-list { display: flex; flex-direction: column; gap: 6px; }
.svc-list:not(:empty) { margin-bottom: 10px; }
.svc { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--alt); }
.svc > div { min-width: 0; overflow-wrap: anywhere; }
.svc-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .85rem; }
.svc-ok .svc-icon { background: var(--accent); }
.svc-bad { background: var(--danger-bg); }
.svc-bad .svc-icon { background: #C4320A; }
.svc-detail { display: block; }

/* Toolbars: search and filter chips; the chips scroll sideways on phones */
.admin-toolbar { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 68px; z-index: 4; margin: 0 -20px; padding: 8px 20px; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.a-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.a-chips::-webkit-scrollbar { display: none; }
.a-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--border); background: #fff; border-radius: 999px; font: inherit; font-size: .88rem;
  font-weight: 600; color: var(--text2); cursor: pointer; white-space: nowrap;
}
.a-chip[aria-checked="true"] { background: var(--tint); border-color: var(--accent); color: var(--accent-h); }
.a-chip-user { background: var(--text); color: #fff; border-color: var(--text); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.a-chip-n { background: var(--alt); border-radius: 999px; padding: 0 7px; font-size: .75rem; color: var(--text2); }
.a-chip-n.hot { background: #C4320A; color: #fff; }

/* Lists */
.admin-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 12px; border-radius: var(--r-sm); }
.admin-row-btn { width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; flex-wrap: nowrap; }
.admin-row-btn:hover { border-color: var(--accent); }
.admin-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 200px; }
.admin-row-main .hint { font-size: .82rem; line-height: 1.4; }
.email { overflow-wrap: anywhere; word-break: break-word; font-weight: 600; }
.paid { color: var(--accent-h); }
.admin-row-side { display: flex; align-items: center; gap: 8px; }
.amount { white-space: nowrap; }
.credit-badge { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 8px; border-radius: 10px; background: var(--tint); color: var(--accent-h); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.credit-badge small { font-size: .68rem; font-weight: 600; }
.credit-badge.zero { background: var(--alt); color: var(--text2); }
.row-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.a-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-h); cursor: pointer; text-align: start; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(8,76,59,.3); }
.more-btn { margin-top: 12px; }
.empty { padding: 18px 0; text-align: center; }
.admin-err { width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.err-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.err-head .pill { padding: 1px 8px; font-size: .75rem; }
.admin-err code { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; color: #7A2E1D; }
.admin-err[aria-expanded="true"] code { display: block; -webkit-line-clamp: unset; }

/* Pictures: a tight grid; details open in a sheet */
.admin-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; }
.admin-pic { position: relative; display: block; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--alt); cursor: pointer; aspect-ratio: 1; }
.admin-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-pic-meta { position: absolute; inset: auto 0 0 0; padding: 14px 6px 4px; font-size: .7rem; color: #fff; text-align: start; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.admin-pic-meta b { text-transform: capitalize; }
.admin-pics .empty { grid-column: 1 / -1; }

/* Sheets: slide up from the bottom on phones, centered panel on bigger screens */
dialog.sheet {
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0;
  border-radius: 20px 20px 0 0; background: #fff; color: var(--text); overflow: hidden; display: none;
  box-shadow: 0 -8px 30px rgba(0,0,0,.15);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .22s ease-out; }
dialog.sheet::backdrop { background: rgba(15,17,20,.45); }
@keyframes sheet-up { from { transform: translateY(30px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }
body.sheet-open { overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.sheet-close { flex: none; width: 44px; height: 44px; margin: -8px -8px -8px 0; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: var(--text2); cursor: pointer; border-radius: 50%; }
.sheet-close:hover { background: var(--alt); }
.sheet-body { padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-body p { margin: 0 0 8px; }
.sheet-email { font-size: 1.02rem; color: var(--text); }
.sheet-h { font-size: .95rem; margin: 20px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-h .a-link { font-size: .88rem; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 0; }
.mini-stats div { background: var(--alt); border-radius: 10px; padding: 8px 4px; text-align: center; min-width: 0; }
.mini-stats strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.mini-stats span { font-size: .7rem; color: var(--text2); line-height: 1.2; display: block; }
.give-form { margin: 0; }
.give-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.give-quick .a-chip { min-width: 48px; justify-content: center; }
.give-row { display: grid; grid-template-columns: 84px 1fr; gap: 8px; }
.give-row .btn { grid-column: 1 / -1; }
.sheet-pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sheet-pics a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--alt); }
.sheet-pics img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.plain li > span:first-child { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.plain li:last-child { border-bottom: 0; }
.plain .pill { font-size: .75rem; padding: 2px 8px; }
.pic-full { display: block; border-radius: 12px; overflow: hidden; background: var(--alt); margin-bottom: 12px; }
.pic-full img { width: 100%; max-height: 50vh; object-fit: contain; display: block; }
.pic-prompt { background: var(--alt); border-radius: 10px; padding: 10px 12px; font-size: .9rem; color: var(--text); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sheet-actions .admin-del { margin: 0; align-self: stretch; }

@media (min-width: 640px) {
  .admin-title { font-size: 1.9rem; }
  .admin { padding-bottom: 60px; }
  .admin-tabs {
    position: sticky; inset: auto; top: 68px; display: flex; gap: 4px; margin: 0 0 14px; padding: 8px 0;
    border-top: 0; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96);
  }
  .admin-tab { flex-direction: row; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: .95rem; gap: 8px; }
  .admin-tab:hover { background: var(--alt); }
  .tab-ico { width: 18px; height: 18px; }
  .admin-tab[aria-selected="true"] { background: var(--text); color: #fff; }
  .admin-tab[aria-selected="true"] .tab-ico { background: none; padding: 0; width: 18px; height: 18px; }
  .admin-tab .tab-count { position: static; font-size: .75rem; padding: 1px 8px; }
  .admin-toolbar { top: 125px; margin: 0; padding: 8px 0; }
  .a-chips { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .admin-toolbar { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .admin-toolbar .input { flex: 1 1 260px; }
  .admin-stats { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .admin-stats .stat { padding: 14px 16px; }
  .admin-stats .stat strong { font-size: 1.6rem; }
  .admin-card { padding: 18px 20px; }
  .kv { grid-template-columns: repeat(4, 1fr); }
  .admin-pics { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .give-row { grid-template-columns: 100px 1fr auto; }
  .give-row .btn { grid-column: auto; }
  dialog.sheet { width: min(600px, calc(100% - 32px)); margin: auto; border-radius: 20px; max-height: 86vh; }
  .sheet-pics { grid-template-columns: repeat(6, 1fr); }
}

.pack-free { font-style: normal; font-family: Inter, 'IBM Plex Sans Arabic', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--accent); margin-inline-start: 4px; white-space: nowrap; }

/* Terms and Privacy pages */
.legal { max-width: 760px; padding-top: 40px; padding-bottom: 80px; }
.legal h1 { font-size: 2rem; margin: 0 0 6px; }
.legal .updated { font-size: 0.875rem; margin-bottom: 28px; }
.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal ul { padding-inline-start: 20px; color: var(--text2); }
.legal li { margin-bottom: 6px; }
.legal [data-doc] { display: none; }
.legal [data-doc].on { display: block; }
.legal-contact a { display: inline-flex; min-height: 44px; align-items: center; margin-inline-end: 18px; }

/* ---------- Create screen: one compact layout for both studios ---------- */
/* Size and versions are one row of chips under the description (the big size tiles and
   the versions picker in More options are gone). */
#createPanel .quick-opts { display: flex !important; }
.quick-opts { margin: 12px 0 4px; }
.qp-size span { white-space: nowrap; }

/* Business studio: the photo step is a light panel with the two buttons side by side. */
#createPanel:not(.mode-free) .upload-box { border: 0; background: var(--alt); padding: 14px; gap: 10px; }
#createPanel:not(.mode-free) .upload-btns { grid-template-columns: 1fr 1fr; }
#createPanel:not(.mode-free) .upload-btns .btn { min-height: 50px; font-size: 0.95rem; padding: 8px 10px; }
.upload-hint.no-photo { font-size: 0.85rem; }
#promptSection .step-h { margin-top: 22px; }

@media (max-width: 600px) {
  /* No card around the whole form: full width, one box deep. */
  .studio { gap: 14px; }
  .studio-title { display: none; }
  .studio-tabs { margin-top: 12px; }
  #createPanel.card { border: 0; border-radius: 0; padding: 0; background: transparent; box-shadow: none; }
  .section-title { font-size: 1.02rem; margin: 20px 0 10px; }
  #createPanel > div:first-child > .section-title:first-child { margin-top: 4px; }
  /* Ideas scroll edge to edge */
  .idea-row { margin-inline: -20px; padding-inline: 20px 28px; scroll-padding-inline: 20px; }
  .prompt-main .prompt-box { min-height: 96px; }
  .quick-opts { gap: 8px; }
  .more > summary { padding: 12px 14px; }
}
#createPanel .quick-opts { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px 12px; }
.qo-label { font-size: 0.88rem; font-weight: 600; color: var(--text2); white-space: nowrap; }

/* ---------- Idea cards (both studios): a real example picture for every idea ---------- */
.idea-cards { gap: 10px; padding-top: 2px; padding-bottom: 4px; }
.idea-card { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px; flex: none; padding: 0; border: 0; background: none; cursor: pointer; color: var(--text2); font: inherit; }
.idea-thumb { position: relative; width: 84px; height: 84px; border-radius: 16px; border: 0; box-shadow: inset 0 0 0 1px rgba(21,23,26,.08); transition: transform .15s ease, box-shadow .15s ease; }
.idea-thumb img { border-radius: inherit; }
.idea-card:hover .idea-thumb { transform: translateY(-2px); }
.idea-card:active .idea-thumb { transform: scale(.97); }
.idea-card[aria-pressed="true"] .idea-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.idea-card[aria-pressed="true"] .idea-name { color: var(--accent-h); }
.idea-card:focus-visible { outline: none; }
.idea-card:focus-visible .idea-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.idea-name { font-size: 0.8rem; font-weight: 600; line-height: 1.2; text-align: center; max-width: 84px; overflow-wrap: anywhere; }
.idea-tick { position: absolute; top: 6px; inset-inline-end: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.idea-card[aria-pressed="true"] .idea-tick { opacity: 1; transform: none; }
.idea-thumb-icon { background: var(--tint); }
@media (prefers-reduced-motion: reduce) { .idea-thumb, .idea-tick { transition: none; } }
.adv-more .idea-row { margin-inline: 0; padding-inline: 0 28px; }
.btn-delete { color: #B42318; min-width: 44px; padding-inline: 10px; }
.btn-delete:hover { border-color: #B42318; background: #FEF3F2; }
.admin-del { color: #B42318; }
.admin-del:hover { border-color: #B42318; background: #FEF3F2; }

/* ---------- Picture cards: one main action, then a compact tool row ---------- */
.gen-actions, .gen-actions.gen-actions-one { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gen-actions.gen-actions-one > .btn { grid-column: 1 / -1; }
.gen-tools { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; }
.gen-tools .btn { min-height: 44px; padding-inline: 8px; }
.gen-retry { flex-direction: column; gap: 0 !important; line-height: 1.15; }
.gen-retry small { font-size: 0.72rem; font-weight: 500; color: var(--accent); }
.gen-retry:disabled small { color: inherit; }

/* ---------- Buy page packs: name and price on one line, per-picture price under ---------- */
.option .pk-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }
.option .pk-name { font-weight: 700; }
.option .pk-price { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.option .pk-sub { display: block; color: var(--text2); font-size: 0.9rem; }

/* The brand name shows on phones only where the header has room (studio and landing). */
@media (max-width: 560px) { body:not(.has-name) .site-header .logo span:last-child { display: none; } }
