/* ================================================================
   Page-specific styles for Profile, Balance, Trash
   (Originally inline in Jinja2 templates, now extracted to CSS)
   ================================================================ */

/* ── Profile ──────────────────────────────────────── */
.profile-page { padding: 28px 32px; max-width: 780px; margin: 0 auto; }
.profile-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.profile-header-title { font-size: 18px; font-weight: 700; color: var(--hl-text); }
.profile-header-title i { color: var(--hl-accent2); margin-right: 6px; }

.pcard { background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: 16px; padding: 28px; margin-bottom: 20px; }
.pcard-title { font-size: 13px; font-weight: 700; color: var(--hl-text-dim); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.pcard-title i { color: var(--hl-accent2); }

.avatar-row { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--hl-border); }
.avatar-circle { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--hl-accent), var(--hl-accent2)); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: #fff; flex-shrink: 0; overflow: hidden; border: 2px solid var(--hl-border2); }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-name { font-size: 16px; font-weight: 700; color: var(--hl-text); margin-bottom: 4px; }
.avatar-meta { font-size: 12px; color: var(--hl-text-muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.provider-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.provider-badge.google { background: rgba(66,133,244,.12); border: 1px solid rgba(66,133,244,.3); color: #60a5fa; }
.provider-badge.email { background: rgba(168,85,247,.1); border: 1px solid rgba(168,85,247,.3); color: var(--hl-accent2); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .field-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--hl-text-dim); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 7px; }
.form-label .optional { font-weight: 400; text-transform: none; color: var(--hl-text-muted); letter-spacing: 0; }
.form-input { width: 100%; background: var(--hl-surface2); border: 1.5px solid var(--hl-border); border-radius: 10px; color: var(--hl-text); font-family: 'Poppins', sans-serif; font-size: 14px; padding: 10px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.form-input:focus { border-color: var(--hl-accent2); box-shadow: 0 0 0 3px rgba(168,85,247,.15); }
.form-input::placeholder { color: var(--hl-text-muted); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }
.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 44px; }
.pw-eye { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--hl-text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; transition: color .2s; }
.pw-eye:hover { color: var(--hl-accent2); }
.alert { border-radius: 10px; padding: 11px 15px; font-size: 13px; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 9px; }
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.28); color: #86efac; }
.alert-error   { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.28); color: #fca5a5; }
.alert-warn    { background: rgba(250,204,21,.08); border: 1px solid rgba(250,204,21,.28); color: #fde047; }
.btn-row { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--hl-border); }
.btn-primary { padding: 10px 22px; background: linear-gradient(135deg,#6d28d9,#a855f7); color: #fff; border: none; border-radius: 10px; font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; letter-spacing: .02em; transition: all .2s; box-shadow: 0 4px 16px rgba(124,58,237,.35); display: flex; align-items: center; gap: 7px; }
.btn-primary:hover { background: linear-gradient(135deg,#7c3aed,#c084fc); box-shadow: 0 6px 22px rgba(168,85,247,.45); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Balance ──────────────────────────────────────── */
.balance-page { padding: 28px 32px; max-width: 820px; margin: 0 auto; }
.balance-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.balance-header-title { font-size: 18px; font-weight: 700; color: var(--hl-text); }
.balance-header-title i { color: var(--hl-accent2); margin-right: 6px; }
.balance-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 620px) { .balance-top { grid-template-columns: 1fr; } }
.bcard { background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: 16px; padding: 24px 26px; }
.bcard-label { font-size: 11px; font-weight: 600; color: var(--hl-text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.bcard-label i { color: var(--hl-accent2); font-size: 14px; }
.balance-amount { font-size: 38px; font-weight: 800; background: linear-gradient(135deg,#c084fc,#a855f7 50%,#7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; margin-bottom: 6px; }
.balance-currency { font-size: 13px; color: var(--hl-text-muted); }
.topup-card { background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: 16px; padding: 24px 26px; display: flex; flex-direction: column; justify-content: space-between; }
.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.qa-btn { padding: 6px 14px; background: var(--hl-surface2); border: 1px solid var(--hl-border); border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600; color: var(--hl-text-dim); cursor: pointer; transition: all .15s; }
.qa-btn:hover { border-color: var(--hl-accent2); color: var(--hl-accent2); background: rgba(168,85,247,.08); }
.amount-row { display: flex; gap: 10px; align-items: stretch; }
.amount-input-wrap { position: relative; flex: 1; }
.amount-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; font-weight: 600; color: var(--hl-text-dim); pointer-events: none; }
.amount-input { width: 100%; background: var(--hl-surface2); border: 1.5px solid var(--hl-border); border-radius: 10px; color: var(--hl-text); font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; padding: 10px 12px 10px 28px; outline: none; transition: border-color .2s, box-shadow .2s; }
.amount-input:focus { border-color: var(--hl-accent2); box-shadow: 0 0 0 3px rgba(168,85,247,.15); }
.amount-input::placeholder { color: var(--hl-text-muted); font-weight: 400; }
.btn-topup { padding: 10px 20px; background: linear-gradient(135deg,#6d28d9,#a855f7); color: #fff; border: none; border-radius: 10px; font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s; box-shadow: 0 4px 16px rgba(124,58,237,.35); white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.btn-topup:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(168,85,247,.45); }
.btn-topup:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.tx-section { }
.tx-title { font-size: 13px; font-weight: 700; color: var(--hl-text-dim); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.tx-title i { color: var(--hl-accent2); }
.tx-table { width: 100%; border-collapse: collapse; }
.tx-table th { font-size: 10px; font-weight: 700; color: var(--hl-text-muted); text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 0 12px 10px; border-bottom: 1px solid var(--hl-border); }
.tx-table th:last-child { text-align: right; }
.tx-table td { padding: 12px; font-size: 13px; color: var(--hl-text); border-bottom: 1px solid var(--hl-border); vertical-align: middle; }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tr:hover td { background: rgba(168,85,247,.04); }
.tx-amount { font-weight: 700; text-align: right; white-space: nowrap; }
.tx-amount.positive { color: #34d399; }
.tx-amount.negative { color: #f87171; }
.tx-type-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 1px solid; }
.tx-type-badge.bonus     { color:#a78bfa; border-color:rgba(167,139,250,.3); background:rgba(167,139,250,.08); }
.tx-type-badge.topup     { color:#34d399; border-color:rgba(52,211,153,.3);  background:rgba(52,211,153,.08); }
.tx-type-badge.deduction { color:#f87171; border-color:rgba(248,113,113,.3); background:rgba(248,113,113,.08); }
.tx-type-badge.refund    { color:#60a5fa; border-color:rgba(96,165,250,.3);  background:rgba(96,165,250,.08); }
.tx-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.tx-status-dot.completed { background:#34d399; }
.tx-status-dot.pending   { background:#fbbf24; }
.tx-status-dot.failed    { background:#f87171; }
.tx-status-dot.cancelled { background:#64748b; }
.tx-empty { text-align: center; padding: 48px 20px; color: var(--hl-text-muted); font-size: 13px; }
.tx-empty i { font-size: 36px; display: block; margin-bottom: 10px; opacity: .4; }
.tx-desc { color: var(--hl-text-dim); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-date { color: var(--hl-text-muted); font-size: 12px; white-space: nowrap; }

/* ── Trash ────────────────────────────────────────── */
.trash-page { padding: 24px 28px; max-width: 1400px; margin: 0 auto; }
.trash-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.trash-title { font-size: 17px; font-weight: 700; color: var(--hl-text); display: flex; align-items: center; gap: 8px; }
.trash-title i { color: var(--hl-text-muted); font-size: 19px; }
.trash-count-badge { background: var(--hl-surface2); border: 1px solid var(--hl-border); border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 700; color: var(--hl-text-muted); }
.trash-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.trash-filter-select { background: var(--hl-surface2); border: 1px solid var(--hl-border); border-radius: 8px; color: var(--hl-text); font-size: 12px; padding: 6px 10px; cursor: pointer; outline: none; }
.trash-filter-select:focus { border-color: var(--hl-accent); }
.section-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border: 1px solid; white-space: nowrap; }
.section-badge.IMAGE         { color:#60a5fa; border-color:rgba(96,165,250,.35); background:rgba(96,165,250,.08); }
.section-badge.IMAGE_PRESET  { color:#a78bfa; border-color:rgba(167,139,250,.35); background:rgba(167,139,250,.08); }
.section-badge.VIDEO         { color:#34d399; border-color:rgba(52,211,153,.35); background:rgba(52,211,153,.08); }
.section-badge.MOTION_CONTROL{ color:#fb923c; border-color:rgba(251,146,60,.35); background:rgba(251,146,60,.08); }
.section-badge.OMNI_VIDEO    { color:#f472b6; border-color:rgba(244,114,182,.35); background:rgba(244,114,182,.08); }
.section-badge.VIDEO_EDIT    { color:#facc15; border-color:rgba(250,204,21,.35); background:rgba(250,204,21,.08); }

/* ── Lightbox ─────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 28px; cursor: pointer; opacity: .7; transition: opacity .15s; }
.lightbox-close:hover { opacity: 1; }

/* ── Presets pages ─────────────────────────────────── */
.ps-page { display: flex; flex-direction: column; height: calc(100vh - 60px); overflow: hidden; }
.ps-tabbar { display: flex; align-items: center; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--hl-border); flex-shrink: 0; background: var(--hl-bg); }
.ps-tab { display: flex; align-items: center; gap: 6px; padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--hl-text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; transition: color .15s, border-color .15s; font-family: inherit; }
.ps-tab:hover { color: var(--hl-text); }
.ps-tab.active { color: var(--hl-accent); border-bottom-color: var(--hl-accent); }
.ps-tab-panel { flex: 1; overflow-y: auto; padding: 24px 24px 32px; }

/* ── Preset filters ── */
.ps-filters { padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 8px; }
.ps-filter-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ps-filter-cats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ps-search-wrap { position: relative; flex: 1; min-width: 140px; max-width: 280px; }
.ps-search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--hl-text-muted); pointer-events: none; }
.ps-search { width: 100%; background: var(--hl-surface2); border: 1px solid var(--hl-border); border-radius: 20px; padding: 6px 12px 6px 30px; color: var(--hl-text); font-family: inherit; font-size: 12px; outline: none; transition: border-color .15s; }
.ps-search:focus { border-color: var(--hl-border2); }
.ps-search::placeholder { color: var(--hl-text-muted); }
.ps-gender-btn { height: 30px; padding: 0 13px; border-radius: 20px; border: 1px solid var(--hl-border); background: none; color: var(--hl-text-dim); font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.ps-gender-btn:hover { border-color: var(--hl-border2); color: var(--hl-text); }
.ps-gender-btn.active { background: var(--hl-accent); border-color: var(--hl-accent); color: #fff; }
.ps-cat-chip { height: 28px; padding: 0 11px; border-radius: 20px; border: 1px solid var(--hl-border); background: none; color: var(--hl-text-dim); font-size: 11px; font-weight: 500; font-family: inherit; cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.ps-cat-chip:hover { border-color: var(--hl-border2); color: var(--hl-text); }
.ps-cat-chip.active { border-color: var(--hl-accent); background: var(--hl-accent-bg); color: var(--hl-accent); }

/* Preset cards */
.presets-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 14px; }
.preset-card { position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; aspect-ratio: 9/14; background: var(--hl-surface2); border: 1.5px solid var(--hl-border); transition: transform .18s, border-color .18s, box-shadow .18s; }
.preset-card:hover { transform: translateY(-4px) scale(1.02); border-color: var(--hl-accent); box-shadow: 0 8px 28px rgba(124,58,237,.35); }
.preset-card-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.preset-card-overlay { position: absolute; inset: 0; background: linear-gradient(to top,rgba(10,11,18,.85) 0%,transparent 55%); }
.preset-card-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 12px; font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }
.preset-card-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(124,58,237,.88); display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; opacity: 0; transition: opacity .18s; pointer-events: none; }
.preset-card:hover .preset-card-play { opacity: 1; }
.preset-card-no-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--hl-text-muted); font-size: 12px; }
.preset-card-no-cover i { font-size: 28px; color: var(--hl-accent); opacity: .5; }
.preset-skeleton { border-radius: 14px; aspect-ratio: 9/14; background: var(--hl-surface2); border: 1.5px solid var(--hl-border); animation: skeleton-pulse 1.4s ease-in-out infinite; }

/* Preset modal */
.preset-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.preset-modal-overlay.open { display: flex; }
.preset-modal { background: var(--hl-surface); border: 1.5px solid var(--hl-border); border-radius: 18px; width: min(480px,94vw); max-height: 90vh; overflow-y: auto; position: relative; animation: modal-in .2s ease; }
@keyframes modal-in { from{transform:scale(.96) translateY(10px);opacity:0} to{transform:scale(1) translateY(0);opacity:1} }
.preset-modal-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--hl-surface2); border: 1px solid var(--hl-border); color: var(--hl-text-muted); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; transition: background .13s, color .13s; }
.preset-modal-close:hover { background: var(--hl-border); color: var(--hl-text); }
.preset-modal-cover { width: 100%; height: 180px; border-radius: 16px 16px 0 0; overflow: hidden; background: var(--hl-surface2); }
.preset-modal-cover img, .preset-modal-cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preset-modal-cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--hl-text-muted); font-size: 36px; }
.preset-modal-body { padding: 20px 22px 24px; }
.preset-modal-name { font-size: 20px; font-weight: 800; color: var(--hl-text); margin-bottom: 4px; }
.preset-modal-meta { font-size: 11px; color: var(--hl-text-muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.preset-meta-tag { padding: 2px 8px; border-radius: 4px; background: var(--hl-surface2); border: 1px solid var(--hl-border); font-size: 10px; font-weight: 700; color: var(--hl-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.preset-modal-field { margin-bottom: 14px; }
.preset-modal-label { font-size: 12px; font-weight: 700; color: var(--hl-text-muted); display: block; margin-bottom: 7px; }
.preset-photo-slot { width: 100%; height: 110px; border: 2px dashed var(--hl-border2); border-radius: 12px; cursor: pointer; overflow: hidden; position: relative; background: var(--hl-surface2); transition: border-color .15s, background .15s; }
.preset-photo-slot:hover, .preset-photo-slot.has-photo { border-color: var(--hl-accent); }
.preset-photo-slot.has-photo { border-style: solid; }
.preset-photo-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 5px; color: var(--hl-text-muted); }
.preset-photo-placeholder i { font-size: 24px; }
.preset-photo-placeholder span { font-size: 12px; font-weight: 600; color: var(--hl-text); }
.preset-photo-hint { font-size: 9px !important; color: var(--hl-text-muted) !important; font-weight: 400 !important; }
.preset-photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.preset-photo-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; border-radius: 10px; }
.preset-photo-slot:hover .preset-photo-overlay { opacity: 1; }
.preset-photo-overlay span { font-size: 12px; font-weight: 700; color: #fff; }
.preset-photo-remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); border: none; color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.preset-photo-remove:hover { background: #ef4444; }
.preset-photo-spinning { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--hl-surface2); border-radius: 10px; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(90px,1fr)); gap: 8px; }
.photo-slot { aspect-ratio: 1; border: 2px dashed var(--hl-border2); border-radius: 12px; cursor: pointer; overflow: hidden; position: relative; background: var(--hl-surface2); transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--hl-text-muted); }
.photo-slot:hover { border-color: var(--hl-accent); }
.photo-slot.has-photo { border-style: solid; border-color: var(--hl-accent); cursor: default; }
.photo-slot.uploading { cursor: not-allowed; }
.photo-slot-icon { font-size: 20px; }
.photo-slot-label { font-size: 10px; font-weight: 600; color: var(--hl-text); }
.photo-slot-hint { font-size: 9px; }
.photo-slot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.photo-slot-remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); border: none; color: #fff; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.photo-slot-remove:hover { background: #ef4444; }
.photo-slot-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.photo-slot-num { position: absolute; bottom: 4px; left: 6px; font-size: 9px; font-weight: 700; color: rgba(255,255,255,.8); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.photos-counter { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--hl-surface2); border: 1px solid var(--hl-border); color: var(--hl-text-muted); }
.photos-counter.has-photos { background: var(--hl-accent-bg); border-color: var(--hl-accent); color: var(--hl-accent); }

/* ── Motion control upload zone ─────────────────── */
.mc-upload-zone { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.mc-upload-slot { position: relative; border: 2px dashed var(--border2); border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .15s, background .15s; min-height: 110px; background: var(--surface2); }
.mc-upload-slot:hover { border-color: var(--accent); background: var(--accent-bg); }
.mc-upload-slot.has-file { border-style: solid; border-color: var(--accent); }
.mc-upload-slot.uploading { pointer-events: none; opacity: .7; }
.mc-slot-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 14px 8px; height: 100%; min-height: 110px; text-align: center; }
.mc-slot-icon { font-size: 26px; color: var(--muted2); transition: color .15s; }
.mc-upload-slot:hover .mc-slot-icon, .mc-upload-slot.has-file .mc-slot-icon { color: var(--accent); }
.mc-slot-label { font-size: 12px; font-weight: 700; color: var(--text); }
.mc-slot-hint { font-size: 9px; color: var(--muted2); }
.mc-slot-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.mc-slot-preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.mc-slot-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.42); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; opacity: 0; transition: opacity .15s; }
.mc-upload-slot:hover .mc-slot-overlay { opacity: 1; }
.mc-slot-overlay span { font-size: 11px; color: #fff; font-weight: 600; }
.mc-slot-overlay i { font-size: 20px; color: #fff; }
.mc-slot-remove { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); border: none; color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; transition: background .13s; }
.mc-slot-remove:hover { background: #e53e3e; }
.mc-slot-spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--surface2); border-radius: 10px; }
.cfg-input { width: 100%; padding: 6px 10px; background: var(--surface2); border: 1.5px solid var(--border); border-radius: 7px; font-size: 12px; color: var(--text); font-family: inherit; outline: none; transition: border-color .13s; }
.cfg-input:focus { border-color: var(--accent); }
.cfg-input::placeholder { color: var(--muted2); }
.cfg-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.cfg-row:last-child { margin-bottom: 0; }
.cfg-label { font-size: 11px; font-weight: 600; color: var(--muted2); }
.cfg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-chip { padding: 4px 10px; font-size: 11px; font-weight: 600; background: var(--surface2); border: 1.5px solid var(--border); border-radius: 20px; color: var(--muted2); cursor: pointer; transition: border-color .13s, color .13s, background .13s; }
.cfg-chip:hover, .cfg-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* ── Video Edit upload zone ─────────────────────── */
.ve-upload-zone { position: relative; width: 100%; aspect-ratio: 16/9; border: 2px dashed var(--border2); border-radius: 14px; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: border-color .2s, background .2s; overflow: hidden; margin-bottom: 12px; }
.ve-upload-zone:hover, .ve-upload-zone.drag-over { border-color: var(--accent); background: var(--accent-bg); }
.ve-upload-zone.has-file { border-style: solid; border-color: var(--accent); }
.ve-upload-icon { font-size: 36px; color: var(--muted2); pointer-events: none; z-index: 1; }
.ve-upload-label { font-size: 13px; color: var(--muted2); text-align: center; pointer-events: none; z-index: 1; }
.ve-upload-zone.has-file .ve-upload-icon, .ve-upload-zone.has-file .ve-upload-label { display: none; }
.ve-upload-remove { position: absolute; top: 8px; right: 8px; z-index: 10; background: rgba(0,0,0,.65); border: none; border-radius: 50%; width: 28px; height: 28px; display: none; align-items: center; justify-content: center; color: #fff; font-size: 14px; cursor: pointer; }
.ve-upload-remove:hover { background: rgba(239,68,68,.75); }
.ve-upload-zone.has-file .ve-upload-remove { display: flex; }
.ve-upload-actions { position: absolute; bottom: 8px; left: 0; right: 0; display: none; gap: 6px; justify-content: center; z-index: 10; }
.ve-upload-zone.has-file .ve-upload-actions { display: flex; }
.ve-upload-action-btn { padding: 4px 12px; font-size: 11px; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; color: #fff; cursor: pointer; transition: background .15s; }
.ve-upload-action-btn:hover { background: rgba(65,84,241,.75); }
.ve-uploading-overlay { position: absolute; inset: 0; z-index: 5; background: rgba(0,0,0,.55); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.ve-upload-zone.uploading .ve-uploading-overlay { display: flex; }
.ve-ref-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px; }
.ve-ref-slot { position: relative; aspect-ratio: 1; border: 1.5px dashed var(--border2); border-radius: 10px; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: border-color .2s, background .2s; overflow: hidden; }
.ve-ref-slot:hover { border-color: var(--accent); background: var(--accent-bg); }
.ve-ref-slot.has-file { border-style: solid; border-color: var(--accent); }
.ve-ref-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.ve-ref-icon { font-size: 18px; color: var(--muted2); }
.ve-ref-slot.has-file .ve-ref-icon { display: none; }
.ve-ref-slot-tag { font-size: 9px; font-family: var(--mono); color: var(--muted2); font-weight: 700; }
.ve-ref-slot.has-file .ve-ref-slot-tag { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; background: rgba(0,0,0,.6); color: var(--accent); padding: 2px 0; }
.ve-ref-remove { position: absolute; top: 3px; right: 3px; z-index: 5; background: rgba(0,0,0,.6); border: none; border-radius: 50%; width: 18px; height: 18px; display: none; align-items: center; justify-content: center; color: #fff; font-size: 10px; cursor: pointer; }
.ve-ref-slot.has-file .ve-ref-remove { display: flex; }
.ve-ref-uploading { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; }
.ve-ref-slot.uploading .ve-ref-uploading { display: flex; }
.ve-tag-btns { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.ve-tag-btn { padding: 3px 9px; font-size: 11px; font-family: var(--mono); background: var(--surface2); border: 1.5px solid var(--border); border-radius: 6px; color: var(--accent); cursor: pointer; }
.ve-tag-btn:hover { border-color: var(--accent); background: var(--accent-bg); }

/* ── Buttons in chat ─────────────────────────────── */
.btn-new-chat { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; background: var(--hl-accent); color: #fff; border: none; border-radius: 12px; font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s, box-shadow .2s, transform .2s; box-shadow: 0 4px 14px rgba(149,106,250,.3); }
.btn-new-chat:hover { background: var(--hl-accent2); transform: translateY(-1px); }

/* ── Media library modal ─────────────────────────── */
.ml-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.ml-modal-overlay.open { display: flex; }
.ml-modal { background: var(--hl-surface); border: 1.5px solid var(--hl-border2); border-radius: 20px; width: min(760px,96vw); max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; animation: modal-in .2s ease; }
.ml-modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hl-border); flex-shrink: 0; }
.ml-modal-title { font-size: 15px; font-weight: 700; color: var(--hl-text); display: flex; align-items: center; gap: 7px; flex: 1; }
.ml-modal-tabs { display: flex; gap: 4px; }
.ml-tab-btn { padding: 6px 14px; background: transparent; border: 1.5px solid var(--hl-border); border-radius: 8px; color: var(--hl-text-muted); font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.ml-tab-btn.active { background: var(--hl-accent); border-color: var(--hl-accent); color: #fff; }
.ml-close-btn { background: var(--hl-surface2); border: 1px solid var(--hl-border); border-radius: 8px; color: var(--hl-text-muted); font-size: 18px; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.ml-close-btn:hover { background: var(--hl-border); color: var(--hl-text); }
.ml-modal-body { flex: 1; overflow-y: auto; padding: 16px; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 10px; }
.ml-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--hl-surface2); cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.ml-item:hover { border-color: var(--hl-accent); transform: scale(1.02); }
.ml-item img, .ml-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ml-item-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.ml-item:hover .ml-item-overlay { opacity: 1; }
.ml-item-use-btn { padding: 6px 14px; background: var(--hl-accent); border: none; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.ml-empty { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--hl-text-muted); font-size: 13px; text-align: center; }
.ml-empty i { font-size: 36px; opacity: .4; }

/* ================================================================
   HOME PAGE
================================================================ */

.hl-home {
  min-height: 100vh;
  background: var(--hl-bg);
  color: var(--hl-text);
  display: flex;
  flex-direction: column;
  font-family: 'Poppins', 'Nunito', sans-serif;
}

/* ── Header ── */
.hl-home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
  background: var(--hl-bg2);
  border-bottom: 1px solid var(--hl-border);
  box-shadow: 0 1px 20px rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
}

.hl-home-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--hl-text) !important;
  font-size: 17px;
  font-weight: 700;
}
.hl-home-logo img { height: 32px; }

.hl-home-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hl-home-theme-btn {
  background: none;
  border: 1px solid var(--hl-border2);
  border-radius: 8px;
  color: var(--hl-text-dim);
  cursor: pointer;
  padding: 6px 9px;
  font-size: 17px;
  line-height: 1;
  transition: all .2s;
}
.hl-home-theme-btn:hover { border-color: var(--hl-accent2); color: var(--hl-neon); }

.hl-home-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: var(--hl-gradient);
  border: none;
  border-radius: 10px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: all .2s;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(124,58,237,.4);
}
.hl-home-app-btn:hover { opacity: .9; transform: translateY(-1px); }

/* ── Hero ── */
.hl-home-hero {
  position: relative;
  text-align: center;
  padding: 80px 24px 52px;
  overflow: hidden;
}

.hl-home-hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(124,58,237,.18) 0%, transparent 65%);
  pointer-events: none;
}

.hl-home-hero-sub {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--hl-accent2);
  margin-bottom: 14px;
}

.hl-home-hero-title {
  font-size: clamp(26px, 5vw, 48px);
  font-weight: 800;
  color: var(--hl-text);
  margin-bottom: 52px;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.hl-home-hero-accent {
  background: var(--hl-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Create cards ── */
.hl-home-create-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hl-home-create-card {
  width: 210px;
  padding: 32px 20px 26px;
  background: var(--hl-surface);
  border: 1px solid var(--hl-border);
  border-radius: 20px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all .25s;
  font-family: inherit;
  color: var(--hl-text);
}
.hl-home-create-card:hover {
  border-color: var(--hl-accent2);
  background: var(--hl-surface2);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(124,58,237,.22);
}

.hl-home-create-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--hl-accent-bg);
  border: 1px solid var(--hl-border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--hl-accent2);
  margin-bottom: 6px;
  transition: all .25s;
}
.hl-home-create-card:hover .hl-home-create-icon {
  background: rgba(124,58,237,.2);
  color: var(--hl-neon);
  box-shadow: 0 0 28px rgba(192,132,252,.35);
}

.hl-home-create-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--hl-text);
}

.hl-home-create-desc {
  font-size: 12px;
  color: var(--hl-text-muted);
  line-height: 1.5;
}

/* ── Presets sections ── */
.hl-home-presets-section {
  padding: 0 0 44px;
  overflow: hidden;
}

.hl-home-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--hl-text);
  padding: 0 32px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.hl-home-section-title i { color: var(--hl-accent2); }

/* ── Infinite carousel ── */
.hl-home-carousel-wrap {
  overflow: hidden;
  padding: 4px 0 16px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 80px, #000 calc(100% - 80px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 80px, #000 calc(100% - 80px), transparent 100%);
}

@keyframes hl-scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.hl-home-carousel-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: hl-scroll-left 45s linear infinite;
  padding: 0 32px;
}
.hl-home-carousel-track:hover { animation-play-state: paused; }
.hl-home-carousel-static { animation: none; }

/* ── Preset cards ── */
.hl-home-preset-card {
  width: 190px;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--hl-surface);
  border: 1px solid var(--hl-border);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .25s;
}
.hl-home-preset-card:hover {
  border-color: var(--hl-accent2);
  box-shadow: 0 8px 32px rgba(124,58,237,.28);
  transform: scale(1.03);
}

.hl-home-preset-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hl-home-preset-no-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--hl-border2);
}

.hl-home-preset-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
  padding: 28px 12px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hl-home-preset-skeleton {
  background: var(--hl-surface2);
  animation: hl-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes hl-skeleton-pulse {
  0%, 100% { opacity: .5; }
  50%       { opacity: 1; }
}

@media (max-width: 600px) {
  .hl-home-hero { padding: 56px 16px 40px; }
  .hl-home-create-cards { gap: 12px; }
  .hl-home-create-card { width: 100%; max-width: 280px; }
  .hl-home-section-title { padding: 0 16px 14px; }
}
