* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #000; color: #FFF; font-family: 'Sora', sans-serif; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ===== SPLASH ===== */
#splash { position: fixed; inset: 0; z-index: 9999; background: #0A0A0A; display: flex; align-items: center; justify-content: center; transition: opacity .4s ease; }
#splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; padding: 0 28px; }
.splash-title { font-family: 'Fraunces', serif; font-size: 34px; font-weight: 600; color: #FFF; margin-bottom: 14px; }
.splash-tagline-fr { font-size: 14px; color: #E0A847; font-weight: 500; letter-spacing: .02em; margin-bottom: 8px; }
.splash-tagline-ar { font-size: 15px; color: #CFCFCF; font-weight: 500; line-height: 1.6; }

/* ===== HEADER ===== */
#header { position: sticky; top: 0; z-index: 50; background: #000; border-bottom: 1px solid #1A1A1A; }
#categories { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; }
#categories::-webkit-scrollbar { display: none; }
.chip { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 13px; padding: 7px 16px; border-radius: 999px; border: 1.5px solid #262626; background: #161616; color: #B0B0B0; cursor: pointer; white-space: nowrap; transition: all .15s; }
.chip.active { background: #FFF; border-color: #FFF; color: #000; }

/* ===== HORIZONTAL ROWS ===== */
.hrow { padding: 16px 0 4px; }
.hrow-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 10px; }
.hrow-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hrow-ico { width: 18px; height: 18px; flex-shrink: 0; color: #FFF; }
.hrow-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.hrow-scroll::-webkit-scrollbar { display: none; }
.hcard { flex: 0 0 auto; width: 168px; cursor: pointer; scroll-snap-align: start; }
.hcard-media { position: relative; width: 168px; height: 220px; border-radius: 16px; overflow: hidden; background: #141414; }
.hcard-media img { width: 100%; height: 100%; object-fit: cover; }
.hcard-stats { position: absolute; bottom: 7px; left: 7px; background: rgba(10,10,10,.7); backdrop-filter: blur(4px); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600; color: #FFF; }
/* likes: 0 = white heart, 1+ = red heart + red number */
.lk { display: inline-flex; align-items: center; gap: 3px; color: #FFF; }
.lk svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lk.on { color: #FF6B6B; }
.lk.on svg { fill: currentColor; }
.catalog-head { padding: 18px 16px 8px; }

/* ===== MASONRY ===== */
/* Columns are built in app.js (fillMasonry) so the NEWEST designs sit on the top row. */
.masonry { display: flex; align-items: flex-start; gap: 3px; padding: 4px 3px 84px; }
.masonry-col { flex: 1 1 0; min-width: 0; }
.card { break-inside: avoid; margin-bottom: 3px; overflow: hidden; background: #141414; border-radius: 14px; cursor: pointer; }
.card-media { position: relative; width: 100%; }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.new-badge { position: absolute; top: 8px; left: 8px; background: #FFF; color: #000; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .08em; text-transform: uppercase; z-index: 2; }
.heart-btn { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 999px; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; transition: transform .15s; z-index: 2; }
.heart-btn:hover { transform: scale(1.08); }
.heart-btn svg { width: 15px; height: 15px; }
.card-ribbon { position: absolute; bottom: 8px; left: 8px; display: flex; align-items: center; gap: 8px; background: rgba(10,10,10,.65); backdrop-filter: blur(4px); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 600; color: #FFF; z-index: 2; }
.card-ribbon .stat { display: flex; align-items: center; gap: 3px; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; margin: 0; color: #FFF; }

/* ===== PAGES ===== */
.view { min-height: 100vh; }
.page { padding-bottom: 84px; }
.page-topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; background: #0A0A0A; border-bottom: 1px solid #1A1A1A; padding: 14px 16px; }
.page-topbar h2 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.back-btn { background: none; border: none; color: #FFF; cursor: pointer; display: flex; align-items: center; }
.back-btn svg { width: 22px; height: 22px; }

/* ===== SEARCH ===== */
.search-topbar { gap: 12px; }
.search-field { flex: 1; position: relative; display: flex; align-items: center; }
.search-field-icon { position: absolute; left: 10px; width: 16px; height: 16px; color: #6B6B6B; pointer-events: none; }
#search-input { width: 100%; background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 14px; padding: 10px 12px 10px 34px; outline: none; -webkit-appearance: none; }
#search-input:focus { border-color: #FFF; }
#search-input::placeholder { color: #555; }
#search-cancel { background: none; border: none; color: #FFF; font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* ===== DETAIL ===== */
.detail-image { width: 100%; background: #141414; position: relative; max-height: 72vh; aspect-ratio: 4 / 5; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; height: 100%; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: center; height: 100%; }
.gallery-slide img { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .25s ease; }
.gallery-slide img.loaded { opacity: 1; }
.gallery-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; z-index: 3; }
.gdot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; transition: all .2s; }
.gdot.active { background: #FFF; width: 20px; border-radius: 99px; }
.detail-actions { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #1A1A1A; }
.detail-category { font-size: 11px; font-weight: 700; color: #E0A847; text-transform: uppercase; letter-spacing: .06em; }
.detail-icons { display: flex; gap: 18px; }
.d-icon { background: none; border: none; color: #B0B0B0; display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; cursor: pointer; }
.d-icon svg { width: 21px; height: 21px; }
.d-icon .heart-icon { stroke: #FF6B6B; fill: none; }
.d-icon.liked { color: #FF6B6B; }
.d-icon.liked .heart-icon { fill: #FF6B6B; }
.detail-info { padding: 16px; }
.detail-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.info-line { font-size: 14px; color: #C9C9C9; line-height: 1.6; }
.info-extra { margin-top: 6px; }
.detail-explain { font-size: 13px; color: #C9C9C9; background: #131313; border: 1px solid #222; border-radius: 10px; padding: 10px 12px; line-height: 1.55; margin-bottom: 10px; }
.detail-explain strong { color: #FFF; }
.buy-note { margin-top: 10px; font-size: 13px; color: #E0A847; background: #161616; border: 1px solid #262626; border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.show-more-btn { margin-top: 8px; background: none; border: none; color: #FFF; font-weight: 600; font-size: 13px; cursor: pointer; }
.buy-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 18px; padding: 15px; background: #2AABEE; color: #FFF; text-decoration: none; border-radius: 14px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; border: none; cursor: pointer; box-shadow: 0 6px 20px rgba(42,171,238,.3); }
.buy-btn:active { opacity: .85; }

/* ===== COMMENTS ===== */
.comments-section { padding: 0 16px 32px; border-top: 1px solid #1A1A1A; }
.comments-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; padding: 14px 0 12px; }
.comment-form { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-bottom: 20px; }
.comment-form input { flex: 1; background: #161616; border: 1.5px solid #262626; border-radius: 999px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 14px; padding: 11px 16px; outline: none; -webkit-appearance: none; }
.comment-form input:focus { border-color: #FFF; }
.comment-form input::placeholder { color: #555; }
.comment-send-btn { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: #FFF; color: #000; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .15s, transform .15s; }
.comment-send-btn:active { opacity: .8; transform: scale(.94); }
.comment-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.comment-send-btn svg { width: 18px; height: 18px; }
.comments-loading, .comments-empty { font-size: 13px; color: #555; text-align: center; padding: 16px 0; }
.comment { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid #161616; }
.comment:last-child { border-bottom: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.comment-time { font-size: 11px; color: #555; margin-bottom: 4px; }
.comment-text { font-size: 13px; color: #C0C0C0; line-height: 1.5; word-break: break-word; }
.comment-like-btn { background: none; border: none; color: #6B6B6B; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; cursor: pointer; flex-shrink: 0; padding: 2px 4px; }
.comment-like-btn.liked { color: #FF6B6B; }

/* ===== FAVORITES ===== */
#favorites-masonry { padding: 12px 3px 84px; }
.empty-msg { text-align: center; color: #6B6B6B; font-size: 14px; padding: 60px 24px; line-height: 1.6; }

/* ===== PROFILE / MON ESPACE ===== */
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 32px 20px 24px; background: #000; border-bottom: 1px solid #1A1A1A; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: #262626; color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 22px; flex-shrink: 0; letter-spacing: .02em; }
.profile-avatar.is-pro { background: #262626; box-shadow: 0 0 0 2px #E0A847; }
.profile-identity { min-width: 0; }
.profile-name { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-tag { font-size: 13px; color: #999; margin-top: 2px; display: block; }
.pro-badge-inline { font-family: 'Sora', sans-serif; font-size: 10px; font-weight: 700; background: linear-gradient(135deg,#E0A847,#B8935A); color: #FFF; padding: 3px 9px; border-radius: 99px; letter-spacing: .05em; }

.profile-pro-cta { margin: 16px; background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(224,168,71,.15)); border: 1px solid rgba(224,168,71,.25); border-radius: 14px; padding: 16px; text-align: center; }
.profile-pro-cta p { font-size: 14px; color: #FFF; font-weight: 600; margin-bottom: 12px; }

.profile-menu { padding: 8px 12px 0; }
.profile-menu-item { width: 100%; display: flex; align-items: center; gap: 14px; background: none; border: none; border-bottom: 1px solid #161616; color: #EEE; font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 500; padding: 16px 8px; cursor: pointer; text-decoration: none; text-align: left; }
.profile-menu-item:active { background: #141414; }
.profile-menu-item > svg:first-child { width: 21px; height: 21px; color: #FFF; flex-shrink: 0; }
.profile-menu-item span { flex: 1; }
.profile-menu-item .chevron { width: 18px; height: 18px; color: #555; }
.profile-footer { text-align: center; color: #555; font-size: 12px; line-height: 1.6; padding: 28px 20px 100px; }

/* ===== BOTTOM NAV ===== */
#bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: #0A0A0A; border-top: 1px solid #1A1A1A; display: flex; align-items: center; justify-content: space-around; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.nav-btn { background: none; border: none; color: #6B6B6B; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 10px; }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: #FFF; }
.nav-btn-hero, .nav-btn-hero.active { background: #FFF; border-radius: 999px; width: 48px; height: 48px; margin-top: -22px; color: #000; box-shadow: 0 6px 16px rgba(255,255,255,.18); }
.nav-btn-hero svg { width: 20px; height: 20px; }
.nav-btn-hero.pulse { animation: heroPulse 1.4s ease-in-out infinite; }
@keyframes heroPulse {
  0%,100% { box-shadow: 0 6px 16px rgba(255,255,255,.18), 0 0 0 0 rgba(255,255,255,.45); }
  50%     { box-shadow: 0 6px 16px rgba(255,255,255,.18), 0 0 0 12px rgba(255,255,255,0); }
}
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; background: #262626; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 1.5px solid #6B6B6B; }
.nav-btn-profile.active .nav-avatar { border-color: #FFF; }
.nav-avatar.is-pro { background: #262626; border-color: #E0A847; }

/* ===== TOOLS PANEL ===== */
.tools-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 200; opacity: 0; pointer-events: none; }
.tools-overlay.open { opacity: 1; pointer-events: all; }
.tools-panel { position: fixed; inset: 0; background: #0F0F0F; z-index: 201; padding: 18px 24px 56px; overflow-y: auto; opacity: 0; visibility: hidden; pointer-events: none; }
.tools-panel.open { opacity: 1; visibility: visible; pointer-events: auto; }
.tools-handle { width: 40px; height: 4px; background: #333; border-radius: 99px; margin: 0 auto 16px; }
.tools-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.tools-title { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.tools-subtitle { font-size: 12px; color: #888; margin-top: 3px; font-weight: 500; }
.tools-close { background: #222; border: none; color: #999; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tools-close svg { width: 16px; height: 16px; }
.pro-cta { background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(224,168,71,.15)); border: 1px solid rgba(224,168,71,.25); border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.pro-cta-text { font-size: 13px; color: #E0A847; font-weight: 600; }
.pro-cta-btn { background: #FFF; color: #000; border: none; padding: 10px 16px; border-radius: 10px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 4px 14px rgba(255,255,255,.12); }
.pro-cta-btn:active { opacity: .85; }
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tool-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; padding: 10px 6px; border-radius: 16px; position: relative; }
.tool-item:active { background: #1a1a1a; }
.tool-icon { position: relative; width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: opacity .2s; }
.tool-icon svg { width: 28px; height: 28px; }
.tool-name { font-family: 'Sora', sans-serif; font-size: 11px; font-weight: 600; color: #C9C9C9; text-align: center; line-height: 1.3; }
.lock-badge { position: absolute; bottom: -4px; right: -4px; width: 22px; height: 22px; background: #1a1a1a; border: 2px solid #111; border-radius: 99px; display: none; align-items: center; justify-content: center; }
.lock-badge svg { width: 11px; height: 11px; }
.tool-item.locked .lock-badge { display: flex; }

/* ===== MODALS ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 300; opacity: 0; pointer-events: none; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { position: fixed; inset: 0; background: #0F0F0F; z-index: 301; overflow-y: auto; opacity: 0; visibility: hidden; pointer-events: none; }
.modal.open { opacity: 1; visibility: visible; pointer-events: auto; }
@media (min-width: 640px) {
  .modal { left: 50%; right: 0; transform: none; max-width: 560px; margin: 0 auto; border-left: 1px solid #1A1A1A; border-right: 1px solid #1A1A1A; }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; border-bottom: 1px solid #1A1A1A; position: sticky; top: 0; background: #111; z-index: 2; }
.modal-header h2 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.modal-close { background: #222; border: none; color: #999; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 20px 20px 32px; }
.modal-body h4 { font-family: 'Fraunces', serif; font-size: 14px; color: #E0A847; margin: 14px 0 4px; }
.modal-body p { font-size: 13px; color: #C0C0C0; line-height: 1.6; }
.modal-body h4:first-child { margin-top: 0; }
.about-logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 2px solid #262626; display: block; }

.pro-intro { font-size: 14px; color: #C9C9C9; line-height: 1.6; margin-bottom: 18px; }
.pro-intro strong { color: #E0A847; }
.pro-benefits { background: #161616; border-radius: 12px; padding: 14px; margin-bottom: 20px; }
.pro-benefit { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #C9C9C9; padding: 4px 0; }
.pro-check { color: #1F9B5F; font-weight: 700; font-size: 14px; }
.pro-form { display: flex; flex-direction: column; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; color: #999; font-weight: 600; }
.form-field input, .form-field select { background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 14px; padding: 12px 14px; outline: none; -webkit-appearance: none; }
.form-field input:focus, .form-field select:focus { border-color: #FFF; }
.form-field input::placeholder { color: #555; }
.pro-submit-btn { background: #FFF; color: #000; border: none; padding: 14px; border-radius: 12px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; cursor: pointer; margin-top: 8px; box-shadow: 0 4px 14px rgba(255,255,255,.12); }
.pro-submit-btn:active { opacity: .85; }
.pro-submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.pro-disclaimer { font-size: 11px; color: #666; text-align: center; margin-top: 4px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(16px); background: #222; color: #FFF; font-size: 13px; font-weight: 600; padding: 10px 20px; border-radius: 99px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; z-index: 400; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Telegram contact item accent (last menu item) */
.profile-menu-telegram > svg:first-child { color: #2AABEE; }

/* ═══════════ CALCULATEUR PRIX ═══════════ */
.calc-view { position: fixed; inset: 0; z-index: 350; background: #000; overflow-y: auto; transform: translateX(100%); transition: transform .3s cubic-bezier(.32,.72,0,1); }
.calc-view.open { transform: translateX(0); }
.calc-body { padding: 16px 16px 100px; }
.calc-client-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.calc-client-field label { font-size: 12px; color: #999; font-weight: 600; }
.calc-client-field input { background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 15px; padding: 12px 14px; outline: none; -webkit-appearance: none; }
.calc-client-field input:focus { border-color: #FFF; }
.calc-client-field input::placeholder { color: #555; }

.calc-product { background: #111; border: 1px solid #1E1E1E; border-radius: 18px; padding: 16px; margin-bottom: 16px; }
.calc-product-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calc-product-num { font-family: 'Fraunces', serif; font-size: 15px; font-weight: 600; color: #E0A847; }
.calc-remove { background: #1E1E1E; border: none; color: #FF6B6B; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.calc-remove svg { width: 16px; height: 16px; }

.calc-thumb { display: block; width: 100%; height: 180px; border-radius: 14px; overflow: hidden; background: #161616; border: 1.5px dashed #333; margin-bottom: 14px; cursor: pointer; position: relative; }
.calc-thumb.has-img { border-style: solid; border-color: #262626; }
.calc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.calc-thumb-empty { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #666; }
.calc-thumb-empty svg { width: 34px; height: 34px; }
.calc-thumb-empty span { font-size: 13px; font-weight: 500; }

.calc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.calc-field label { font-size: 12px; color: #999; font-weight: 600; }
.calc-field input { background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 15px; padding: 12px 14px; outline: none; -webkit-appearance: none; }
.calc-field input:focus { border-color: #FFF; }
.calc-field input::placeholder { color: #555; }
.calc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc-readout .calc-val { background: #0E0E0E; border: 1.5px solid #1E1E1E; border-radius: 10px; padding: 12px 14px; font-size: 15px; font-weight: 700; color: #E0A847; }
.calc-product-total { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 14px; border-top: 1px solid #1E1E1E; }
.calc-product-total span { font-size: 14px; color: #C9C9C9; font-weight: 600; }
.calc-product-total strong { font-size: 20px; color: #FFF; font-weight: 700; }

.calc-add-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 1.5px dashed #333; color: #FFF; font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14px; padding: 14px; border-radius: 14px; cursor: pointer; margin-bottom: 16px; }
.calc-add-btn svg { width: 18px; height: 18px; }
.calc-add-btn:active { background: #111; }

.calc-grand { background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(224,168,71,.14)); border: 1px solid rgba(224,168,71,.3); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.calc-grand-row { display: flex; align-items: center; justify-content: space-between; }
.calc-grand-row span { font-size: 15px; color: #E0A847; font-weight: 600; }
.calc-grand-row strong { font-size: 26px; color: #FFF; font-weight: 700; }

.calc-share-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; background: #2AABEE; color: #FFF; border: none; padding: 15px; border-radius: 14px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 6px 20px rgba(42,171,238,.3); }
.calc-share-btn:active { opacity: .85; }
.calc-share-btn svg { width: 20px; height: 20px; }

/* ── Formation Wilcom (YouTube) tool icon ───────────────────────── */
.tool-icon-yt { background: #fff; overflow: hidden; }
.tool-icon-yt img { width: 78%; height: auto; object-fit: contain; display: block; }

/* ── Notifications on/off toggle (profile) ──────────────────────── */
.notif-toggle-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px; padding: 14px 16px; background: #101010; border: 1px solid #1d1d1d; border-radius: 14px; }
.notif-toggle-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.notif-toggle-info > svg { width: 22px; height: 22px; color: #FFF; flex-shrink: 0; }
.notif-toggle-title { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 600; color: #EEE; }
.notif-toggle-sub { font-size: 12px; color: #888; margin-top: 2px; }
.notif-switch { position: relative; width: 48px; height: 28px; border: none; border-radius: 99px; background: #2a2a2a; cursor: pointer; flex-shrink: 0; padding: 0; transition: background .25s; }
.notif-switch-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .25s; }
.notif-switch.on { background: #FFF; }
.notif-switch.on .notif-switch-knob { background: #000; }
.notif-switch.on .notif-switch-knob { transform: translateX(20px); }
.notif-switch.pending { opacity: .6; pointer-events: none; }

/* ── Calculateur Prix — refined product card ────────────────────── */
.calc-name { flex: 1; min-width: 0; background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #E0A847; font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; padding: 9px 12px; outline: none; -webkit-appearance: none; margin-right: 10px; }
.calc-name:focus { border-color: #FFF; }
.calc-name::placeholder { color: #6b5a36; font-style: italic; font-weight: 600; }

/* Coef (left) + prix broderie réel en blanc (right) on one line */
.calc-coef-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.calc-coef-group { display: flex; align-items: center; gap: 8px; }
.calc-coef-label { font-size: 13px; color: #999; font-weight: 600; }
.calc-coef { width: 70px; background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 15px; padding: 10px 12px; outline: none; -webkit-appearance: none; text-align: center; }
.calc-coef:focus { border-color: #FFF; }
.calc-broderie-real { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: #FFF; white-space: nowrap; }

/* Dotted leader rows — values align on the right edge */
.calc-leader-line, .calc-other-line, .calc-total-line { display: flex; align-items: flex-end; }
.calc-dots { flex: 1 1 auto; min-width: 16px; border-bottom: 2px dotted #3a3a3a; margin: 0 8px 5px; }

/* prix arrondi (or) */
.calc-leader-line { margin-top: 6px; }
.calc-broderie-round { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; color: #E0A847; white-space: nowrap; }

/* Autres frais : libellé + champ or + DA hors champ */
.calc-other-line { margin-top: 10px; }
.calc-other-label { font-size: 14px; color: #C9C9C9; font-weight: 600; white-space: nowrap; }
.calc-other-input-wrap { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.calc-other { width: 92px; background: transparent; border: none; border-bottom: 1.5px solid #2a2a2a; border-radius: 0; color: #E0A847; font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; padding: 2px 2px 4px; outline: none; -webkit-appearance: none; text-align: right; }
.calc-other:focus { border-bottom-color: #E0A847; }
.calc-other::placeholder { color: #5a4a2a; }
.calc-da { font-size: 14px; font-weight: 700; color: #E0A847; }
.calc-other-hint { font-size: 12px; color: #777; margin-top: 4px; }

/* Total produit */
.calc-total-line { margin-top: 12px; padding-top: 14px; border-top: 1px solid #1E1E1E; }
.calc-total-line .calc-dots { margin-bottom: 8px; }
.calc-total-label { font-size: 15px; color: #C9C9C9; font-weight: 700; white-space: nowrap; }
.calc-total-val { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; color: #E0A847; white-space: nowrap; }

/* ── Sliding calc view stays GPU-promoted; panels are instant now ── */
.calc-view { will-change: transform; }

/* ── Contact block (Messenger + Telegram) ───────────────────────── */
.contact-block { margin-top: 18px; }
.contact-label { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600; color: #999; margin-bottom: 10px; }
.contact-btns { display: flex; gap: 10px; }
.contact-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: none; border-radius: 14px; color: #FFF; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; cursor: pointer; }
.contact-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.contact-btn:active { opacity: .85; }
.contact-btn.messenger { background: linear-gradient(135deg, #0A7CFF, #A033FF); box-shadow: 0 6px 20px rgba(120,80,255,.30); }
.contact-btn.telegram { background: #2AABEE; box-shadow: 0 6px 20px rgba(42,171,238,.30); }

/* ── Avatar colour swatches ─────────────────────────────────────── */
.avatar-colors { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 16px 0; }
.avatar-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; outline: none; transition: transform .12s; }
.avatar-swatch:active { transform: scale(.9); }
.avatar-swatch.sel { border-color: #FFF; box-shadow: 0 0 0 2px #0A0A0A, 0 0 0 4px rgba(255,255,255,.25); }

/* Hide bottom-sheet grab handle (panels are full-screen now) */
.tools-handle { display: none; }

/* Arabic tagline at the bottom of the profile */
.footer-ar { display: inline-block; margin-top: 6px; color: #6a6a6a; font-size: 13px; }

/* ── Stitch breakdown (product detail) ──────────────────────────── */
.stitch-box { margin: 14px 0 4px; padding: 16px; background: #101010; border: 1px solid #1E1E1E; border-radius: 14px; }
.stitch-title { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700; color: #999; margin-bottom: 12px; }
.stitch-row, .stitch-total { display: flex; align-items: flex-end; }
.stitch-row { margin-bottom: 8px; }
.stitch-name { font-size: 14px; color: #C9C9C9; font-weight: 600; white-space: nowrap; }
.stitch-dots { flex: 1 1 auto; min-width: 14px; border-bottom: 2px dotted #333; margin: 0 8px 5px; }
.stitch-val { font-family: 'Sora', sans-serif; font-size: 14px; color: #FFF; font-weight: 600; white-space: nowrap; }
.stitch-total { margin-top: 10px; padding-top: 12px; border-top: 1px solid #1E1E1E; }
.stitch-total > span:first-child { font-size: 14px; font-weight: 700; color: #C9C9C9; }
.stitch-total strong { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 800; color: #E0A847; white-space: nowrap; }
.stitch-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stitch-copy, .stitch-calc { flex: 1; min-width: 140px; padding: 11px 12px; border-radius: 10px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; border: 1.5px solid #2a2a2a; background: #161616; color: #E0A847; }
.stitch-calc { border: none; background: #FFF; color: #000; }
.stitch-copy:active, .stitch-calc:active { opacity: .85; }

/* Kill the Android tap-highlight flash + accidental text selection on controls */
* { -webkit-tap-highlight-color: transparent; }
.nav-btn, .profile-menu-item, .tool-item, .card, .hcard, button, .contact-btn, .avatar-swatch, .gdot { -webkit-user-select: none; user-select: none; }
.card img, .hcard-media img, .gallery-slide img { -webkit-touch-callout: none; }

/* ── Comment replies ── */
.comment-thread { border-bottom: 1px solid #161616; }
.comment-thread:last-child { border-bottom: none; }
.comment-thread .comment { border-bottom: none; }
.comment-reply-btn { background: none; border: none; color: #FFF; font-size: 12px; font-weight: 600; padding: 6px 0 0; cursor: pointer; }
.comment-replies { margin: 2px 0 6px 20px; padding-left: 12px; border-left: 2px solid #222; }
.comment.is-reply { padding: 8px 0; }
.reply-box { display: flex; gap: 8px; margin: 6px 0 12px 20px; }
.reply-input { flex: 1; background: #161616; border: 1.5px solid #262626; border-radius: 999px; color: #FFF; font-family: 'Sora', sans-serif; font-size: 13px; padding: 9px 14px; outline: none; -webkit-appearance: none; }
.reply-input:focus { border-color: #FFF; }
.reply-input::placeholder { color: #555; }
.reply-send { flex-shrink: 0; background: #FFF; color: #000; border: none; border-radius: 999px; padding: 0 16px; font-weight: 700; font-size: 13px; font-family: 'Sora', sans-serif; cursor: pointer; }
.reply-send:disabled { opacity: .45; cursor: not-allowed; }

/* ── Splash retry (shown if the app fails to load) ── */
#splash-error { margin-top: 26px; }
#splash-error .splash-err-fr { font-size: 14px; color: #E0A847; margin: 0 0 4px; }
#splash-error .splash-err-ar { font-size: 13px; color: #999; margin: 0 0 16px; font-family: 'Tajawal', sans-serif; }
#splash-retry { background: #E6B85C; color: #111; border: none; border-radius: 12px; padding: 13px 26px; font-size: 14px; font-weight: 700; font-family: 'Sora', sans-serif; cursor: pointer; }
#splash-retry:active { transform: translateY(1px); }

/* ── In-app notifications ── */
#nav-notif { position: relative; }
.notif-badge { position: absolute; top: 3px; left: 50%; transform: translateX(2px); min-width: 16px; height: 16px; padding: 0 4px; background: #E5484D; color: #fff; font-size: 10px; font-weight: 800; border-radius: 999px; display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px #0A0A0A; }
.notif-badge[hidden] { display: none !important; }   /* let the "hidden" attribute actually hide the dot (overrides display:flex) */
.notif-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .28s ease; z-index: 1298; }
.notif-overlay.open { opacity: 1; pointer-events: auto; }
.notif-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 380px); background: #0E0E0E; border-left: 1px solid #1d1d1d; z-index: 1305; transform: translateX(102%); transition: transform .28s ease; display: flex; flex-direction: column; }
.notif-panel.open { transform: translateX(0); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 14px; border-bottom: 1px solid #1a1a1a; }
.notif-head h3 { font-family: 'Fraunces', serif; font-size: 20px; margin: 0; }
.notif-head button { background: none; border: none; color: #888; font-size: 19px; cursor: pointer; padding: 4px; }
#notif-list { overflow-y: auto; padding: 8px; flex: 1; }
.notif-empty { color: #666; text-align: center; padding: 48px 16px; font-size: 14px; }
.notif-item { display: flex; gap: 12px; padding: 12px; border-radius: 12px; }
.notif-item.unread { background: rgba(224,168,71,.09); }
.notif-ico { width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; background: #1a1a1a; border-radius: 50%; font-size: 15px; }
.notif-body { font-size: 13.5px; color: #e0e0e0; line-height: 1.45; }
.notif-body b { color: #fff; }
.notif-snippet { display: block; color: #999; font-size: 12.5px; margin-top: 2px; }
.notif-time { display: block; color: #666; font-size: 11px; margin-top: 4px; }

/* ── FIRST-OPEN ONBOARDING ────────────────────────────────────── */
.onboard-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(2px); z-index: 95; animation: obFade .25s ease; }
.onboard-backdrop[hidden] { display: none !important; }
@keyframes obFade { from { opacity: 0; } to { opacity: 1; } }
.onboard-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, 88vw); z-index: 96; background: #141414; border: 1px solid #2A2A2A; border-radius: 22px; padding: 32px 24px 26px; text-align: center; box-shadow: 0 18px 60px rgba(0,0,0,.65); animation: obRise .35s cubic-bezier(.2,.8,.2,1); }
.onboard-card[hidden] { display: none !important; }
@keyframes obRise { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.onboard-emoji { font-size: 34px; margin-bottom: 6px; }
.onboard-skip { position: absolute; top: 10px; right: 12px; background: none; border: none; color: #6B6B6B; font-size: 16px; cursor: pointer; padding: 4px; }
.onboard-en { font-size: 17px; font-weight: 800; color: #FFF; line-height: 1.3; margin: 4px 0 6px; }
.onboard-ar { font-size: 14px; color: #C9C9C9; margin: 0 0 16px; line-height: 1.5; }
.onboard-cta { width: 100%; background: #FFF; color: #000; border: none; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 800; cursor: pointer; }
.onboard-hint { font-size: 12px; color: #8A8A8A; margin: 12px 0 0; }
.onboard-browse { display: block; width: 100%; margin: 14px auto 0; background: none; border: none; color: #E0A847; font-size: 13.5px; font-weight: 700; cursor: pointer; padding: 8px; }
.onboard-browse:active { opacity: .7; }
.notif-badge-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── CARD TAP HINT (تلميح: cards are openable) ─────────────────── */
.card-media { position: relative; }
.card-tap-hint { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(2px); pointer-events: none; letter-spacing: .2px; }
.card { transition: transform .12s ease; }
.card:active { transform: scale(.985); }

/* ── COMMENT REPLY ROUTING (Author › ParentAuthor) ────────────── */
.creply-arrow { color: #FFF; font-weight: 800; margin: 0 3px; }
.reply-box { flex-wrap: wrap; }
.reply-target { flex-basis: 100%; width: 100%; font-size: 11px; color: #FFF; font-weight: 600; margin-bottom: 5px; }

.notif-clickable { cursor: pointer; }
.notif-clickable:active { background: rgba(255,255,255,.04); }

/* ═══════════════ CAHIER DES COMMANDES ═══════════════ */
.cahier-view{position:fixed;inset:0;z-index:1400;background:#0A0A0B;color:#F0EBE2;transform:translateX(100%);transition:transform .32s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column;overflow:hidden}
.cahier-view.open{transform:translateX(0)}
.cah-topbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 14px 10px;border-bottom:1px solid rgba(217,179,108,.18)}
.cah-topbar h2{font-family:"Playfair Display",Georgia,serif;font-size:19px;font-weight:700;color:#F0EBE2;margin:0}
.cah-topbar .back-btn{background:none;border:none;color:#F0EBE2;padding:6px;cursor:pointer;width:38px;height:38px;display:flex;align-items:center;justify-content:center}
.cah-topbar .back-btn svg{width:24px;height:24px}
.cah-tabs{display:flex;gap:6px;padding:12px;overflow-x:auto;-webkit-overflow-scrolling:touch;flex:0 0 auto}
.cah-tab{flex:0 0 auto;background:transparent;border:1px solid rgba(240,235,226,.14);color:rgba(240,235,226,.6);padding:8px 16px;border-radius:999px;font-size:14px;font-weight:600;cursor:pointer;transition:.15s;font-family:inherit}
.cah-tab.active{background:rgba(217,179,108,.16);border-color:rgba(217,179,108,.5);color:#D9B36C}
.cah-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:110px}
.cah-empty{text-align:center;color:rgba(240,235,226,.45);padding:60px 24px;font-size:15px;line-height:1.7}

.cah-card{padding:14px 16px;border-bottom:1px solid rgba(240,235,226,.08)}
.cah-card-main{display:flex;gap:12px;align-items:center}
.cah-thumb{width:52px;height:52px;border-radius:10px;background-size:cover;background-position:center;flex:0 0 auto;background-color:#1a1a1c}
.cah-thumb-ph{display:flex;align-items:center;justify-content:center;font-family:"Playfair Display",Georgia,serif;font-size:22px;color:#D9B36C;background:rgba(217,179,108,.12)}
.cah-card-info{flex:1;min-width:0}
.cah-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.cah-client{font-weight:600;font-size:16px;color:#F0EBE2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cah-deadline{flex:0 0 auto;font-size:12.5px;color:rgba(240,235,226,.55);white-space:nowrap}
.cah-deadline.urgent{color:#D9B36C;font-weight:700}
.cah-money{margin-top:4px;font-size:13.5px;color:rgba(240,235,226,.7)}
.cah-money b{font-family:"Playfair Display",Georgia,serif;color:#F0EBE2;font-weight:600}
.cah-reste{color:#D9B36C;font-weight:600}
.cah-paid{color:#5cc88a;font-weight:700}
.cah-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.cah-act{background:rgba(240,235,226,.06);border:1px solid rgba(240,235,226,.1);color:rgba(240,235,226,.85);padding:6px 12px;border-radius:8px;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit}
.cah-act-done{color:#5cc88a;border-color:rgba(92,200,138,.3)}
.cah-act-del{color:#e57373;border-color:rgba(229,115,115,.25);margin-left:auto}
.cah-details{max-height:0;overflow:hidden;transition:max-height .25s ease}
.cah-details.open{max-height:420px;margin-top:10px}
.cah-details>div{display:flex;gap:10px;font-size:13px;padding:5px 0;border-top:1px solid rgba(240,235,226,.06);color:rgba(240,235,226,.85)}
.cah-details>div span{color:rgba(240,235,226,.45);flex:0 0 92px}

.cah-client-row{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid rgba(240,235,226,.08);cursor:pointer}
.cah-avatar{width:44px;height:44px;border-radius:50%;background:rgba(217,179,108,.14);color:#D9B36C;display:flex;align-items:center;justify-content:center;font-family:"Playfair Display",Georgia,serif;font-size:20px;flex:0 0 auto}
.cah-client-mid{flex:1;min-width:0}
.cah-client-name{font-weight:600;font-size:16px;color:#F0EBE2}
.cah-client-sub{font-size:12.5px;color:rgba(240,235,226,.55);margin-top:2px}
.cah-client-spent{font-family:"Playfair Display",Georgia,serif;font-size:18px;color:#D9B36C;font-weight:600;flex:0 0 auto}

.cah-bilan{padding:24px 20px}
.cah-bilan-label{text-align:center;color:rgba(240,235,226,.55);font-size:14px}
.cah-bilan-total{text-align:center;font-family:"Playfair Display",Georgia,serif;font-size:52px;font-weight:700;color:#D9B36C;margin:6px 0 22px}
.cah-bilan-total span{font-size:22px;color:rgba(217,179,108,.6)}
.cah-goal-bar{height:12px;background:rgba(240,235,226,.08);border-radius:999px;overflow:hidden}
.cah-goal-fill{height:100%;background:linear-gradient(90deg,#B8935A,#D9B36C);border-radius:999px;transition:width .5s}
.cah-goal-row{display:flex;justify-content:space-between;align-items:center;margin-top:8px;font-size:13px;color:rgba(240,235,226,.6)}
.cah-goal-edit{background:none;border:none;color:#D9B36C;font-size:13px;cursor:pointer;font-weight:600;font-family:inherit}
.cah-past{margin-top:28px;border-top:1px solid rgba(240,235,226,.1)}
.cah-past-row{display:flex;justify-content:space-between;padding:12px 2px;border-bottom:1px solid rgba(240,235,226,.06);font-size:14px;color:rgba(240,235,226,.75)}
.cah-past-row b{font-family:"Playfair Display",Georgia,serif;color:#F0EBE2}

.cah-fab{position:absolute;right:20px;bottom:24px;width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,#D9B36C,#c09a52);color:#0A0A0B;border:none;font-size:32px;font-weight:300;line-height:1;cursor:pointer;box-shadow:0 8px 24px rgba(217,179,108,.35);z-index:5}

/* dark modals */
#cah-form-overlay,#cah-client-overlay,#cah-share-overlay{z-index:1600}
.cah-modal{z-index:1601 !important;background:#141416 !important;color:#F0EBE2 !important}
.cah-modal .modal-header{border-bottom:1px solid rgba(240,235,226,.1)}
.cah-modal .modal-header h3{color:#F0EBE2;font-family:"Playfair Display",Georgia,serif}
.cah-modal .modal-close{color:rgba(240,235,226,.7)}
.cah-input{width:100%;background:rgba(240,235,226,.05);border:1px solid rgba(240,235,226,.14);color:#F0EBE2;padding:12px 14px;border-radius:10px;font-size:15px;margin-bottom:10px;box-sizing:border-box;font-family:inherit}
.cah-input::placeholder{color:rgba(240,235,226,.4)}
.cah-input:focus{outline:none;border-color:#D9B36C}
.cah-field-label{display:block;font-size:12px;color:rgba(240,235,226,.5);margin:2px 2px 4px}
.cah-row2{display:flex;gap:10px}
.cah-row2>div{flex:1}
.cah-reste-box{background:rgba(217,179,108,.1);border:1px solid rgba(217,179,108,.25);border-radius:10px;padding:10px 14px;margin-bottom:10px;font-size:14px;color:rgba(240,235,226,.8)}
.cah-reste-box b{font-family:"Playfair Display",Georgia,serif;color:#D9B36C;font-size:18px}
.cah-toggle{display:flex;align-items:center;gap:10px;font-size:14px;color:rgba(240,235,226,.8);margin:6px 0 16px;cursor:pointer}
.cah-toggle input{width:18px;height:18px;accent-color:#D9B36C}
.cah-photo-label{display:flex;flex-direction:column;align-items:center;gap:8px;margin-bottom:14px;cursor:pointer}
.cah-photo-prev{width:88px;height:88px;border-radius:14px;background:rgba(240,235,226,.06);border:2px dashed rgba(217,179,108,.35);background-size:cover;background-position:center}
.cah-photo-prev.has{border-style:solid;border-color:#D9B36C}
.cah-photo-label span{font-size:13px;color:rgba(217,179,108,.9)}
.cah-submit{width:100%;background:linear-gradient(135deg,#D9B36C,#c09a52);color:#0A0A0B;border:none;padding:14px;border-radius:12px;font-size:16px;font-weight:700;cursor:pointer;margin-top:4px;font-family:inherit}
.cah-submit:disabled{opacity:.6}

.cah-cd-sub{color:rgba(240,235,226,.6);font-size:14px;margin:0 0 14px}
.cah-cd-totals{display:flex;gap:12px;margin-bottom:14px}
.cah-cd-totals>div{flex:1;background:rgba(240,235,226,.05);border-radius:12px;padding:12px;text-align:center}
.cah-cd-totals span{display:block;font-size:12px;color:rgba(240,235,226,.5);margin-bottom:4px}
.cah-cd-totals b{font-family:"Playfair Display",Georgia,serif;font-size:22px}
.cah-gold{color:#D9B36C}
.cah-cd-call{width:100%;background:rgba(217,179,108,.14);border:1px solid rgba(217,179,108,.35);color:#D9B36C;padding:11px;border-radius:10px;font-size:15px;font-weight:600;cursor:pointer;margin-bottom:16px;font-family:inherit}
.cah-cd-order{padding:10px 0;border-bottom:1px solid rgba(240,235,226,.07);font-size:14px;color:#F0EBE2}
.cah-cd-line{font-size:13px;color:rgba(240,235,226,.6);margin-top:3px}
.cah-cd-status{font-size:11px;padding:2px 8px;border-radius:999px;margin-left:6px}
.cah-cd-status.termine{background:rgba(92,200,138,.15);color:#5cc88a}
.cah-cd-status.en_cours{background:rgba(217,179,108,.15);color:#D9B36C}
.cah-cd-status.annule{background:rgba(229,115,115,.15);color:#e57373}

.cah-share-img{width:100%;max-width:300px;border-radius:14px;margin:0 auto 16px;display:block}
.cah-share-btns{display:flex;gap:10px}
.cah-share-btns button{flex:1;padding:12px;border-radius:10px;font-size:15px;font-weight:600;cursor:pointer;border:none;font-family:inherit}
.cah-share-send{background:linear-gradient(135deg,#D9B36C,#c09a52);color:#0A0A0B}
.cah-share-dl{background:rgba(240,235,226,.08);color:#F0EBE2;border:1px solid rgba(240,235,226,.15)!important}

/* ── Gold verified seal (embedded inline — replaces the old "PRO" text badge) ── */
.gold-check { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-left: 4px; }

/* ── Embroidery Cleaner placeholder screen ── */
.cleaner-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 28px; min-height: 60vh; gap: 10px; }
.cleaner-soon-ic { font-size: 56px; line-height: 1; }
.cleaner-soon-title { font-size: 20px; font-weight: 700; color: #fff; margin: 6px 0 0; }
.cleaner-soon-sub { font-size: 14px; color: #9fb6d6; line-height: 1.5; max-width: 340px; margin: 0; }
.cleaner-soon-badge { margin-top: 10px; background: rgba(224,168,71,.15); color: #E0A847; border: 1px solid rgba(224,168,71,.4); font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 99px; }

/* ── Freemium paywall modal ── */
.paywall-price { text-align: center; margin: 4px 0 14px; }
.paywall-amount { font-size: 30px; font-weight: 800; color: #E0A847; }
.paywall-per { font-size: 14px; color: #9a9a9a; margin-left: 4px; }
.paywall-pay-label { font-size: 13px; color: #aaa; margin: 14px 0 8px; }
.paywall-pays { display: flex; gap: 10px; margin-bottom: 14px; }
.paywall-pay { flex: 1; padding: 13px 10px; border-radius: 12px; border: 0; font-size: 14px; font-weight: 700; color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.paywall-pay:active { transform: scale(.98); }
.paywall-baridi { background: linear-gradient(135deg, #1f9d55, #17864a); }
.paywall-paypal { background: linear-gradient(135deg, #1546a0, #0f3778); }



/* ═══════════════════════════════════════════════════════════════
   EMBROIDERY CLEANER
   Scoped to #cleaner-view so its tokens can never leak into the app.
   Typography matches the Viewer: Fraunces for numbers, Sora for UI.
   ═══════════════════════════════════════════════════════════════ */
#cleaner-view{
  --bg:#000000; --panel:#111112; --panel2:#161617; --border:#262628;
  --text:#FFFFFF; --muted:#8b8b90; --muted-blue:#9fb6d6;
  --teal:#0FB5AE; --teal-soft:rgba(15,181,174,.14);
  --gold:#E0A847; --gold-soft:rgba(224,168,71,.14);
  --green:#4CC26B; --green-soft:rgba(76,194,107,.14);
  --yellow:#E0A847; --yellow-soft:rgba(224,168,71,.14);
  --red:#E0603C; --red-soft:rgba(224,96,60,.14);
  --r-lg:18px; --r-md:14px; --r-sm:10px;
  --disp:'Fraunces',serif; --body:'Sora',sans-serif;
  background:#000; overflow:hidden;
}
#cleaner-view *{box-sizing:border-box;}
#cleaner-view button{font-family:var(--body);}
.mc-page{width:100%;max-width:560px;margin:0 auto;flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;padding-bottom:calc(84px + env(safe-area-inset-bottom));}
main.mc-main{flex:1;padding:4px 8px 26px;}

/* ── RESULT CHIPS — exactly two lines, edge to edge ──
   Line 1: dot + label. Line 2: the number, then the verdict beside it.
   Nothing wraps to a third line, so five metrics plus the action button pack
   into three tight rows instead of pushing the design off the screen. */
.mc-chips{display:grid;grid-template-columns:1fr 1fr;gap:7px;}
.mc-chip{display:flex;flex-direction:column;justify-content:center;gap:5px;background:var(--panel2);border:1.5px solid var(--border);border-radius:var(--r-md);padding:9px 10px;text-align:left;cursor:default;-webkit-tap-highlight-color:transparent;position:relative;transition:border-color .15s,transform .1s;font-family:var(--body);overflow:hidden;}
.mc-chip.actionable{cursor:pointer;}
.mc-chip.actionable:active{transform:scale(.975);}
.mc-chip-top{display:flex;align-items:center;gap:7px;min-width:0;}
.mc-chip .mc-dot{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--dot-c);box-shadow:0 0 0 3px var(--dot-glow);}
.mc-chip-name{flex:1;min-width:0;font-size:10px;font-weight:700;color:#b9bfc9;text-transform:uppercase;letter-spacing:.02em;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mc-chip-foot{display:flex;align-items:baseline;gap:7px;min-width:0;}
.mc-chip-val{flex:0 0 auto;font-family:var(--disp);font-size:20px;font-weight:600;line-height:1;color:#fff;}
.mc-chip-val small{font-family:var(--body);font-size:10px;font-weight:600;color:#8b8b90;}
.mc-chip-verdict{flex:1;min-width:0;font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mc-chip-fix{flex:0 0 auto;font-size:13px;color:var(--muted);line-height:1;align-self:center;}
.mc-chip-fix.ok{color:var(--green);font-size:11px;}

/* ── 6th cell = the action button, wearing the colour of the worst defect ── */
.mc-chip-cta{display:flex;align-items:center;justify-content:center;border-radius:var(--r-md);padding:9px 10px;cursor:pointer;-webkit-tap-highlight-color:transparent;border:none;text-align:center;background:linear-gradient(135deg,#4CC26B,#37a457);color:#fff;box-shadow:0 6px 16px rgba(76,194,107,.24);font-family:var(--body);}
.mc-chip-cta:active{transform:scale(.975);}
.mc-chip-cta .cta-body{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;}
.mc-chip-cta .cta-title{font-family:var(--disp);font-weight:700;font-size:14px;line-height:1.1;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap;}
.mc-chip-cta .cta-sub{font-size:10px;font-weight:700;opacity:.85;margin-top:3px;white-space:nowrap;}
.mc-chip-cta.clean-done{background:var(--green-soft);border:1.5px solid rgba(76,194,107,.45);color:var(--green);box-shadow:none;}
.mc-chip-cta.cta-amber{background:linear-gradient(135deg,#E0A847,#c48c2c);color:#241a00;box-shadow:0 6px 16px rgba(224,168,71,.24);}
.mc-chip-cta.cta-red{background:linear-gradient(135deg,#E0603C,#c04426);color:#fff;box-shadow:0 6px 18px rgba(224,96,60,.34);animation:ctaPulse 1.9s ease-in-out infinite;}

/* ── CANVAS INFO — same tokens and placement as the Viewer (Sora, not
      Fraunces). The old version stacked Fraunces values in two absolute
      blocks that collided on wide screens. ── */
.mc-ov{position:absolute;z-index:3;pointer-events:none;}
.mc-ov-left{left:12px;bottom:9px;display:flex;flex-direction:column;gap:3px;}
.mc-ov-left .r{display:flex;align-items:baseline;gap:6px;font-size:11.5px;color:#9a9a9a;text-shadow:0 1px 3px rgba(0,0,0,.9);}
.mc-ov-left .r > span{min-width:52px;}
.mc-ov-left .r > b{color:#fff;font-weight:700;font-variant-numeric:tabular-nums;font-family:var(--body);}
.mc-ov-left .mac{pointer-events:auto;cursor:pointer;}
.mc-ov-left .mac > span{color:var(--gold);font-weight:700;}
.mc-ov-left .mac > b.t{color:#cfe3ff;}
.mc-ov-center{left:50%;bottom:10px;transform:translateX(-50%);text-align:center;font-size:14px;color:#fff;font-weight:700;font-variant-numeric:tabular-nums;text-shadow:0 1px 3px rgba(0,0,0,.9);white-space:nowrap;}
.mc-ov-center small{color:#999;font-weight:500;font-size:11px;}
.mc-legend{position:absolute;right:10px;bottom:10px;z-index:3;pointer-events:none;text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:3px;max-height:70%;overflow:hidden;}
.mc-legend-title{font-size:11px;color:#aaa;margin-bottom:1px;text-shadow:0 1px 3px rgba(0,0,0,.9);}
.mc-legend-row{display:flex;align-items:center;gap:6px;}
.mc-legend-sw{width:12px;height:12px;border-radius:3px;border:1px solid rgba(255,255,255,.25);flex:0 0 auto;}
.mc-legend-pts{font-size:11px;color:#ddd;font-weight:700;font-variant-numeric:tabular-nums;text-shadow:0 1px 3px rgba(0,0,0,.9);}

  /* topbar: back | file name | Export */
  .mc-topbar{display:flex;align-items:center;gap:10px;padding:14px 14px 8px;}
  .mc-back{width:38px;height:38px;flex:0 0 auto;border-radius:50%;background:var(--panel2);border:1.5px solid var(--border);color:var(--text);display:flex;align-items:center;justify-content:center;cursor:pointer;-webkit-tap-highlight-color:transparent;}
  .mc-back:active{transform:scale(.94);}
  .mc-topname{flex:1;min-width:0;font-weight:600;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;color:#eaeaea;}
  .mc-topexport{flex:0 0 auto;display:none;align-items:center;gap:6px;background:var(--teal-soft);border:1.5px solid rgba(15,181,174,.5);color:var(--teal);font-weight:700;font-size:13px;padding:8px 13px;border-radius:99px;cursor:pointer;-webkit-tap-highlight-color:transparent;}
  .mc-topexport.show{display:inline-flex;}
  .mc-topexport:active{transform:scale(.96);}
  main.mc-main{flex:1;padding:4px 14px 26px;}
  .mc-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:40px 20px 20px;gap:8px;}
  .mc-empty-ic{font-size:50px;line-height:1;}
  .mc-empty-title{font-family:var(--disp);font-size:19px;font-weight:600;margin:8px 0 0;line-height:1.3;}
  .mc-empty-sub{font-size:14px;color:var(--muted-blue);line-height:1.55;max-width:340px;margin:0;}
  .mc-pick-btn{margin-top:18px;width:100%;max-width:320px;background:linear-gradient(135deg,#0FB5AE,#12a89b);color:#04211f;border:none;padding:15px;border-radius:var(--r-md);font-weight:800;font-size:15px;cursor:pointer;box-shadow:0 8px 22px rgba(15,181,174,.28);-webkit-tap-highlight-color:transparent;}
  .mc-pick-btn:active{transform:scale(.98);}
  .mc-demo-btn{margin-top:10px;width:100%;max-width:320px;background:none;border:1.5px dashed #333;color:#cfe3ff;padding:12px;border-radius:var(--r-md);font-weight:600;font-size:13.5px;cursor:pointer;}
  .mc-demo-btn:active{transform:scale(.98);}
  .mc-privacy{margin-top:16px;font-size:12px;color:#6f7a86;}
  .mc-formats{margin-top:2px;font-size:11px;color:#555;}
  /* diagnostic dashboard */
  .mc-diag{background:linear-gradient(180deg,#141416,#101012);border:1.5px solid var(--border);border-radius:var(--r-lg);padding:12px 9px 10px;margin:6px 0 12px;position:relative;overflow:hidden;}
  .mc-diag::before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:linear-gradient(90deg,var(--green),var(--yellow),var(--red));opacity:.55;}
  .mc-diag-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:12px;}
  .mc-score-ring{flex:0 0 auto;width:61px;height:61px;border-radius:50%;display:flex;align-items:center;justify-content:center;position:relative;background:conic-gradient(var(--score-c) calc(var(--score)*1%),#2a2a2c 0);}
  .mc-score-ring::after{content:"";position:absolute;inset:4px;border-radius:50%;background:#0e0e10;}
  .mc-score-num{position:relative;z-index:1;font-family:var(--disp);font-weight:700;font-size:21px;line-height:1;}
  .mc-score-meta{flex:1;min-width:0;padding-top:2px;}
  .mc-score-label{font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);}
  .mc-score-verdict{font-family:var(--disp);font-size:17px;font-weight:600;margin-top:1px;}
  .mc-score-hint{font-size:11.5px;color:#9aa1ad;margin-top:2px;line-height:1.4;}
  .mc-freecount{flex:0 0 auto;align-self:flex-start;background:var(--gold-soft);border:1px solid rgba(224,168,71,.4);color:var(--gold);font-size:10.5px;font-weight:700;line-height:1.15;text-align:center;padding:5px 9px;border-radius:99px;white-space:nowrap;}
  .mc-freecount small{display:block;font-size:8.5px;font-weight:600;color:rgba(224,168,71,.75);}
  .mc-chip.good{--dot-c:var(--green);--dot-glow:var(--green-soft);border-color:rgba(76,194,107,.32);}
  .mc-chip.warn{--dot-c:var(--yellow);--dot-glow:var(--yellow-soft);border-color:rgba(224,168,71,.36);}
  .mc-chip.bad{--dot-c:var(--red);--dot-glow:var(--red-soft);border-color:rgba(224,96,60,.42);}
  .mc-chip.good .mc-chip-verdict{color:var(--green);}
  .mc-chip.warn .mc-chip-verdict{color:var(--yellow);}
  .mc-chip.bad .mc-chip-verdict{color:var(--red);}
  /* Tout nettoyer — occupies the empty 6th cell (bottom-right), two lines like the cards */
  @keyframes ctaPulse{0%,100%{box-shadow:0 6px 18px rgba(224,96,60,.30);}50%{box-shadow:0 6px 26px rgba(224,96,60,.55);}}
  /* stage */
  .mc-stage-wrap{position:relative;border-radius:var(--r-lg);overflow:hidden;border:1.5px solid var(--border);background:#08080a;}
  #mc-canvas{display:block;width:100%;height:420px;touch-action:none;}
  .mc-clean-badge{position:absolute;top:10px;left:50%;transform:translateX(-50%);background:rgba(76,194,107,.16);border:1px solid rgba(76,194,107,.55);color:var(--green);font-size:11px;font-weight:700;padding:5px 10px;border-radius:99px;display:none;align-items:center;gap:5px;z-index:4;}
  .mc-clean-badge.show{display:inline-flex;}
  .mc-stackleg{position:absolute;top:54px;left:50%;transform:translateX(-50%);cursor:pointer;pointer-events:auto;display:none;align-items:center;gap:6px;background:rgba(20,20,22,.82);border:1px solid rgba(224,96,60,.5);color:#f0a08c;font-size:11px;font-weight:700;padding:5px 10px;border-radius:99px;backdrop-filter:blur(3px);z-index:4;}
  .mc-stackleg.show{display:inline-flex;}
  .mc-stackleg .dot{width:8px;height:8px;border-radius:50%;background:#E0603C;animation:legPulse 1.4s ease-in-out infinite;}
  @keyframes legPulse{0%,100%{opacity:.5;transform:scale(.85);}50%{opacity:1;transform:scale(1.15);}}
  .mc-corner-btn{display:inline-flex;align-items:center;gap:6px;background:rgba(20,20,22,.82);border:1.5px solid var(--border);color:#eaeaea;font-weight:700;font-size:12.5px;padding:7px 11px;border-radius:99px;cursor:pointer;backdrop-filter:blur(3px);-webkit-tap-highlight-color:transparent;}
  .mc-corner-btn:active{transform:scale(.96);}
  .mc-open-canvas{position:absolute;top:10px;left:10px;z-index:6;}
  .mc-edit-wrap{position:absolute;top:10px;right:10px;z-index:6;}
  .mc-edit-btn .chev{transition:transform .18s;font-size:10px;}
  .mc-edit-wrap.open .chev{transform:rotate(180deg);}
  .mc-edit-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:186px;background:#161618;border:1.5px solid var(--border);border-radius:var(--r-md);padding:5px;opacity:0;visibility:hidden;transform:translateY(-6px);transition:all .16s;box-shadow:0 12px 30px rgba(0,0,0,.5);}
  .mc-edit-wrap.open .mc-edit-menu{opacity:1;visibility:visible;transform:translateY(0);}
  .mc-edit-item{display:flex;align-items:center;gap:9px;width:100%;background:none;border:none;color:#e6e6e6;font-size:13px;font-weight:600;padding:10px 10px;border-radius:9px;cursor:pointer;text-align:left;}
  .mc-edit-item:active{background:#202022;}
  .mc-edit-item .ei{font-size:15px;width:20px;text-align:center;}
  .mc-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s;z-index:50;}
  .mc-overlay.open{opacity:1;visibility:visible;pointer-events:auto;}
  .mc-modal{position:fixed;left:0;right:0;bottom:0;max-width:520px;margin:0 auto;background:#121214;border:1.5px solid var(--border);border-bottom:none;border-radius:22px 22px 0 0;transform:translateY(100%);visibility:hidden;pointer-events:none;transition:transform .22s cubic-bezier(.2,.8,.3,1),visibility .22s;z-index:51;max-height:88vh;display:flex;flex-direction:column;}
  .mc-modal.open{transform:translateY(0);visibility:visible;pointer-events:auto;}
  .mc-modal-head{display:flex;align-items:center;gap:10px;padding:18px 18px 10px;border-bottom:1px solid #1e1e20;}
  .mc-modal-ic{width:36px;height:36px;border-radius:11px;background:var(--teal-soft);display:flex;align-items:center;justify-content:center;font-size:17px;flex:0 0 auto;}
  .mc-modal-title{font-family:var(--disp);font-size:17px;font-weight:600;flex:1;}
  .mc-modal-close{width:30px;height:30px;border-radius:50%;background:#1c1c1e;border:none;color:#ccc;font-size:15px;cursor:pointer;flex:0 0 auto;}
  .mc-modal-body{padding:16px 18px 6px;overflow-y:auto;}
  .mc-modal-foot{display:flex;gap:10px;padding:14px 18px calc(16px + env(safe-area-inset-bottom));}
  .mc-btn-ghost{flex:1;background:none;border:1.5px solid var(--border);color:#ccc;padding:13px;border-radius:var(--r-md);font-weight:700;font-size:14px;cursor:pointer;}
  .mc-btn-primary{flex:1.4;background:linear-gradient(135deg,#0FB5AE,#12a89b);color:#04211f;border:none;padding:13px;border-radius:var(--r-md);font-weight:800;font-size:14px;cursor:pointer;}
  .mc-btn-primary:active,.mc-btn-ghost:active{transform:scale(.97);}
  .mc-btn-primary.gold{background:linear-gradient(135deg,#E0A847,#c98f38);color:#241a00;}
  .mc-btn-primary:disabled{opacity:.5;}
  .mc-note{font-size:13px;color:#cfd6e0;line-height:1.55;margin:0 0 14px;}
  .mc-tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;color:var(--teal);background:var(--teal-soft);border:1px solid rgba(15,181,174,.4);padding:4px 9px;border-radius:99px;margin-bottom:12px;}
  .mc-tag.red{color:var(--red);background:var(--red-soft);border-color:rgba(224,96,58,.4);}
  .mc-tag.warn{color:var(--yellow);background:var(--yellow-soft);border-color:rgba(224,168,71,.4);}
  .mc-tag.green{color:var(--green);background:var(--green-soft);border-color:rgba(76,194,107,.4);}
  .mc-compare{display:flex;align-items:center;gap:10px;background:var(--panel2);border:1.5px solid var(--border);border-radius:var(--r-md);padding:14px;margin-bottom:14px;}
  .mc-compare-col{flex:1;text-align:center;}
  .mc-compare-label{display:block;font-size:10px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em;}
  .mc-compare-val{display:block;font-family:var(--disp);font-size:20px;font-weight:600;margin-top:4px;}
  .mc-compare-after .mc-compare-val{color:var(--green);}
  .mc-compare-arrow{color:#555;font-size:16px;}
  .mc-checklist{list-style:none;padding:0;margin:0 0 8px;}
  .mc-checklist li{display:flex;align-items:center;gap:10px;padding:11px 12px;background:var(--panel2);border:1.5px solid var(--border);border-radius:var(--r-md);margin-bottom:8px;}
  .mc-checklist .cl-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto;}
  .mc-checklist .cl-name{flex:1;font-size:13px;font-weight:600;}
  .mc-checklist .cl-count{font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;}
  .mc-checklist .warn{color:var(--yellow);} .mc-checklist .bad{color:var(--red);}
  .mc-input{width:100%;background:#1a1a1c;border:1.5px solid var(--border);border-radius:var(--r-sm);color:#fff;font-family:var(--body);font-size:15px;padding:11px 12px;outline:none;}
  .mc-row2{display:flex;gap:10px;align-items:center;}
  .mc-row2 .mc-input{flex:1;}
  .mc-preset{flex:1;padding:10px 4px;border-radius:var(--r-sm);border:1.5px solid var(--border);background:#1a1a1c;color:#ccc;font-size:12px;font-weight:700;cursor:pointer;text-align:center;}
  .mc-preset.on{border-color:var(--teal);color:var(--teal);background:var(--teal-soft);}
  .mc-field-label{font-size:12px;font-weight:700;color:#aeb6c2;margin:14px 0 6px;display:flex;justify-content:space-between;}
  .mc-price-card{border:1.5px solid rgba(224,168,71,.4);background:var(--gold-soft);border-radius:var(--r-md);padding:14px;margin-bottom:12px;}
  .mc-price-top{display:flex;justify-content:space-between;align-items:baseline;}
  .mc-price-name{font-family:var(--disp);font-weight:600;font-size:15px;color:#fff;}
  .mc-price-val{font-family:var(--disp);font-weight:700;font-size:20px;color:var(--gold);}
  .mc-price-sub{font-size:11.5px;color:#c9b48a;margin-top:4px;}
  .mc-toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,20px);background:#1c1c1e;border:1.5px solid #333;color:#fff;font-size:13.5px;font-weight:600;padding:11px 18px;border-radius:99px;opacity:0;transition:all .2s;pointer-events:none;z-index:80;max-width:90%;text-align:center;}
  .mc-toast.show{opacity:1;transform:translate(-50%,0);}
/* modals sit above the cleaner layer itself */
#cleaner-view .mc-overlay{z-index:60;}
#cleaner-view .mc-modal{z-index:61;}


/* "J'ai payé" — pulls the new paid state without a reinstall */
.paywall-refresh-btn { width: 100%; margin-top: 9px; background: none; border: 1.5px solid #333; color: #cfe3ff; padding: 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.paywall-refresh-btn:active { transform: scale(.98); }
.paywall-refresh-btn:disabled { opacity: .6; }

/* ═══════════════════════════════════════════════════════════════
   VIEWER — brought in line with the Cleaner.
   Sensitive info (defects) at the top, passive info (size, counts,
   colours) along the bottom of the canvas, exactly as in the Cleaner.
   ═══════════════════════════════════════════════════════════════ */

/* Blue Export door in the topbar — the Cleaner's shape, the Viewer's colour */
.emb-export-btn { display: flex; align-items: center; gap: 7px; background: rgba(42,122,238,.14); border: 1.5px solid rgba(42,122,238,.55); color: #6db2ff; padding: 8px 14px; border-radius: 99px; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; flex: 0 0 auto; }
.emb-export-btn svg { width: 16px; height: 16px; }
.emb-export-btn:active { transform: scale(.97); }

/* ── HEALTH STRIP (short) ── */
.emb-health { position: relative; overflow: hidden; display: flex; align-items: center; gap: 11px; padding: 11px 11px 10px; margin: 8px 10px 0; background: linear-gradient(180deg,#141416,#101012); border: 1.5px solid #262628; border-radius: 16px; }
.emb-health::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg,#4CC26B,#E0A847,#E0603C); opacity: .55; }
.emb-health-ring { position: relative; width: 61px; height: 61px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--hc,#4CC26B) calc(var(--hp,0)*1%), #232326 0); }
.emb-health-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #121214; }
.emb-health-ring span { position: relative; z-index: 1; font-family: 'Fraunces', serif; font-size: 21px; font-weight: 700; color: var(--hc,#4CC26B); }
.emb-health-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.emb-health-item { display: flex; align-items: flex-start; gap: 7px; min-width: 0; font-weight: 600; color: #aeb6c2; background: none; border: 0; padding: 0; font-family: inherit; text-align: left; cursor: default; -webkit-tap-highlight-color: transparent; }
.hl-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.hl-head { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.hl-head b { color: #fff; font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.hl-name { font-size: 11.5px; font-weight: 600; color: #aeb6c2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-risk { font-size: 10.5px; font-weight: 600; line-height: 1.25; color: currentColor; opacity: .95; }
.emb-health-item.ok .hl-risk { display: none; }
.emb-health-item.tappable { cursor: pointer; }
.emb-health-item.tappable:active { opacity: .6; }
.emb-health-item i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.emb-health-item.warn { color: #E0A847; }
.emb-health-item.bad  { color: #E0603C; }
.emb-health-item.ok   { color: #4CC26B; }
.emb-health-item i { margin-top: 5px; }
.emb-health-item.warn i, .emb-health-item.bad i { animation: embDot 1.35s ease-in-out infinite; }
@keyframes embDot { 0%,100%{ opacity:1; transform:scale(1); box-shadow:0 0 0 3px color-mix(in srgb, currentColor 26%, transparent);} 50%{ opacity:.5; transform:scale(.8); box-shadow:0 0 0 6px color-mix(in srgb, currentColor 0%, transparent);} }
.emb-health-item b { color: #fff; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 22px; }
.emb-health-item em { font-style: normal; color: #8b8b90; font-weight: 600; }
.emb-health-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emb-health-more { font-size: 10px; color: #6b6b70; font-weight: 600; padding-left: 15px; }
.emb-health-cta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: none; border-radius: 12px; padding: 8px 10px; min-height: 44px; max-width: 96px; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; background: linear-gradient(135deg,#E0A847,#c48c2c); color: #241a00; }
.emb-health-cta .cta-l1 { font-family: 'Fraunces', serif; font-size: 13px; font-weight: 700; line-height: 1.05; white-space: nowrap; }
.emb-health-cta .cta-l2 { font-size: 9px; font-weight: 700; opacity: .8; white-space: nowrap; }
.emb-health-cta.bad { background: linear-gradient(135deg,#E0603C,#c04426); color: #fff; animation: ctaPulse 1.9s ease-in-out infinite; }
.emb-health-cta.clean { background: rgba(76,194,107,.14); border: 1.5px solid rgba(76,194,107,.4); color: #4CC26B; animation: none; }
.emb-health-cta .ar { font-size: 13px; }
.emb-health-cta:active { transform: scale(.97); }

/* ── canvas: calculator CTA, same line as 3D but on the right ── */
.emb-canvas-calc { position: absolute; top: 10px; right: 10px; z-index: 4; display: flex; align-items: center; gap: 6px; background: rgba(224,168,71,.16); border: 1.5px solid rgba(224,168,71,.5); color: #E0A847; padding: 7px 13px; border-radius: 99px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; backdrop-filter: blur(6px); }
.emb-canvas-calc:active { transform: scale(.97); }

/* ── bottom-left machine row (tap to change speed), matching the Cleaner ── */
.emb-dims .mac { pointer-events: auto; cursor: pointer; }
.emb-dims .mac > span { color: #E0A847; font-weight: 700; min-width: 52px; }
.emb-dims .mac > b { color: #cfe3ff; }

/* ── hero Simuler + speed popover ── */
.emb-play-hero { flex: 1.6 !important; font-weight: 800; }
.emb-speed-pop { margin-top: 10px; background: #141416; border: 1.5px solid #262628; border-radius: 14px; padding: 10px 12px 4px; }
.emb-speed-pop-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #9a9a9a; margin-bottom: 2px; }
.emb-speed-pop-head b { color: #E0A847; font-variant-numeric: tabular-nums; }

/* ── export menu ── */
.emb-exp-list { padding: 6px 14px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.emb-exp-item { display: flex; align-items: center; gap: 12px; width: 100%; background: #161617; border: 1.5px solid #262628; border-radius: 14px; padding: 13px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; text-align: left; font-family: inherit; }
.emb-exp-item:active { transform: scale(.985); }
.emb-exp-item:disabled { opacity: .5; }
.emb-exp-ic { font-size: 20px; flex: 0 0 auto; }
.emb-exp-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.emb-exp-tx b { color: #fff; font-size: 14px; font-weight: 700; }
.emb-exp-tx small { color: #8b8b90; font-size: 11.5px; }
.emb-exp-ar { color: #6b6b70; flex: 0 0 auto; }

/* ── Viewer topbar: Ouvrir sits beside Export ── */
.emb-open-top { display: flex; align-items: center; gap: 6px; background: #1b1b1d; border: 1.5px solid #2c2c2f; color: #d8d8dc; padding: 8px 13px; border-radius: 99px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; flex: 0 0 auto; }
.emb-open-top svg { width: 15px; height: 15px; }
.emb-open-top:active { transform: scale(.97); }

/* palette wheel moved onto the canvas, right of the 3D button */
.emb-scheme-canvas { position: absolute; top: 10px; left: 58px; z-index: 4; }

/* ── Cleaner topbar: Ouvrir + a green Export (the Cleaner's own green) ── */
.mc-topopen { display: flex; align-items: center; gap: 6px; background: #1b1b1d; border: 1.5px solid #2c2c2f; color: #d8d8dc; padding: 8px 13px; border-radius: 99px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; flex: 0 0 auto; }
.mc-topopen:active { transform: scale(.97); }
#cleaner-view .mc-topexport { background: rgba(76,194,107,.12); border: 1.5px solid rgba(76,194,107,.5); color: #4CC26B; }

/* the Cleaner's banner: same component, defect lines are tappable fixes */
.mc-health { margin: 6px 0 10px; }


/* Cleaner canvas: calculator CTA where the Éditer menu used to be */
.mc-canvas-calc { top: 10px; right: 10px; }

/* ── Viewer: give the canvas the height the removed controls freed up ── */
.emb-controls { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)) !important; }
.emb-btn-row { margin-top: 8px; }

/* Saturation drains as the score drops — the file LOOKS sick before you read it.
   Applied to the canvas only, so video/image export keeps its true colours. */
#emb-canvas, #emb-veil, #mc-canvas { transition: filter .45s ease; }

/* Viewer canvas gets the Cleaner's rounded stage container */
.emb-stage-wrap { flex: 1; min-height: 0; display: flex; margin: 9px 10px 0; border-radius: 18px; overflow: hidden; border: 1.5px solid #262628; background: #08080a; }
.emb-stage-wrap > .emb-stage { flex: 1; min-height: 0; }

/* ── Tool identity tag in the header: you always know which tool you're in ── */
.emb-tool-tag { flex: 0 0 auto; font-family: 'Fraunces', serif; font-size: 15px; font-weight: 700; letter-spacing: .07em; }
.emb-tag-viewer  { color: #4a9af0; }
.emb-tag-cleaner { color: #0FB5AE; }

/* filename on the canvas — present, but never competing with the design */
.emb-canvas-file { position: absolute; top: 9px; left: 12px; z-index: 4; max-width: 45%; font-size: 11px; font-weight: 600; color: #7d8694; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.9); }

/* 3D sits in a vertical stack; a colour control can drop in beneath it later */
.emb-tool-stack { position: absolute; top: 30px; left: 10px; z-index: 4; display: flex; flex-direction: column; gap: 8px; }
.emb-tool-stack .emb-3d-btn { position: static !important; }

/* Calculator CTA dims while the file still has defects — same tiers as the
   score ring, so "not green" reads as "not ready to price yet". */
.emb-canvas-calc.not-ready { opacity: .45; filter: saturate(.35); }

/* With the filename gone from both topbars, the tag holds the left edge and
   the action buttons stay pinned right. */
.emb-tool-tag { margin-right: auto; }

/* ── Cahier: a devis waiting on the client ── */
.cah-card.cah-pending { border-color: rgba(224,168,71,.45); background: linear-gradient(180deg,rgba(224,168,71,.07),transparent); }
.cah-pend-tag { font-size: 10.5px; font-weight: 700; color: #E0A847; padding: 8px 12px 0; }
.cah-act-cancel { color: #E0603C !important; border-color: rgba(224,96,60,.45) !important; }

/* ── Profile: edit your own name ── */
.profile-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.profile-name-edit { background: none; border: 1.5px solid #333; color: #9aa3b2; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; cursor: pointer; flex: 0 0 auto; -webkit-tap-highlight-color: transparent; }
.profile-name-edit:active { transform: scale(.94); }

/* ── Paywall step 2 ── */
.paywall-steps { margin: 4px 0 16px; padding-left: 20px; color: #cfd6e2; font-size: 13.5px; line-height: 1.65; }
.paywall-steps li { margin-bottom: 6px; }
.paywall-steps b { color: #fff; }
.paywall-methods { text-align: center; font-size: 12.5px; color: #9aa3b2; margin: 12px 0 4px; }
.paywall-methods b { color: #E0A847; }
.paywall-msg { background: linear-gradient(135deg,#0084FF,#0068c9); }
.paywall-tg  { background: linear-gradient(135deg,#2AABEE,#1c8ec4); }
.paywall-wa  { background: linear-gradient(135deg,#25D366,#1da851); }
.paywall-pay[hidden] { display: none; }
.paywall-back-btn { width: 100%; margin-top: 8px; background: none; border: 0; color: #7d8694; padding: 10px; font-size: 13px; font-family: inherit; cursor: pointer; }

/* Free-credit pill: quiet gold, amber when it's nearly gone, red at zero */
#cleaner-view .mc-freecount.low { background: rgba(224,168,71,.22); border-color: rgba(224,168,71,.7); color: #F0BE66; }
#cleaner-view .mc-freecount.out { background: rgba(224,96,60,.16); border-color: rgba(224,96,60,.55); color: #E0603C; }


/* ═══ BLACK & WHITE — viewer, nav, language (04/10) ═══
   "body" prefix = wins over the inline <style> rules in index.html. */
body .emb-tag-viewer { color: #fff; }
body .emb-export-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.38); color: #fff; }
body .emb-cbtn.emb-play { background: #fff; color: #000; border-color: #fff; }
body .emb-vid-btn { color: #fff; }
body .emb-vid-btn:active, body .emb-3d-btn.on { background: #fff; border-color: #fff; color: #000; }
body .emb-canvas-calc { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.38); color: #fff; }
body .nav-btn-hero { background: #fff; color: #000; box-shadow: 0 6px 16px rgba(255,255,255,.16); }
body .nav-btn-hero.pulse { animation-name: heroPulseW; }
@keyframes heroPulseW {
  0%,100% { box-shadow: 0 6px 16px rgba(255,255,255,.16), 0 0 0 0 rgba(255,255,255,.4); }
  50%     { box-shadow: 0 6px 16px rgba(255,255,255,.16), 0 0 0 12px rgba(255,255,255,0); }
}
.mbh-list[dir="ltr"] .mbh-go svg { transform: scaleX(-1); }
.mbh-lang { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); right: 16px; z-index: 2; background: #0b0b0b; border: 1px solid #333; color: #fff; font: 600 13px/1 system-ui, sans-serif; padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.mb-lang-seg { display: flex; gap: 2px; background: #0b0b0b; border: 1px solid #2a2a2a; border-radius: 999px; padding: 3px; flex: 0 0 auto; }
/* 29/10 · 4 languages (عربي · FR · ES · EN) in the same pill */
.mb-lang-seg button { border: 0; background: transparent; color: #aaa; font: 700 12.5px/1 system-ui, sans-serif; padding: 8px 9px; border-radius: 999px; cursor: pointer; }
.mb-lang-seg button.on { background: #fff; color: #000; }


/* ═══ NAV FIX + CALCULATOR black & white (05/10) ═══
   Nav bug: ".nav-btn.active{color:#fff}" is stronger than the white button's black icon,
   so after visiting a tab the 4 squares turned white on the white circle. */
body .nav-btn-hero, body .nav-btn-hero.active, body .nav-btn-hero:active, body .nav-btn-hero:focus { color: #000; }

body .calc-top-row { display: flex; align-items: flex-end; justify-content: flex-start; gap: 12px; margin-bottom: 16px; }
body .calc-currency-field { flex: 0 0 auto; width: auto; margin: 0; }
body .calc-currency-field select { height: 46px; min-width: 84px; margin: 0; }
body .calc-share-btn { background: #fff; color: #000; border: 0; box-shadow: none; font-weight: 700; border-radius: 14px; }
body .calc-share-top { flex: 0 0 auto; width: auto; height: 46px; padding: 0 18px; margin: 0; font-size: 14px; gap: 8px; }
body .calc-share-top svg { width: 18px; height: 18px; }

body .calc-client-field input:focus, body .calc-field input:focus, body .calc-name:focus, body .calc-coef:focus { border-color: #fff; }
body .calc-name { color: #fff; font-style: normal; }
body .calc-name::placeholder { color: #777; font-style: italic; }

body .calc-coef-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body .calc-coef-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
body .calc-thread { -webkit-appearance: none; appearance: none; background: #161616 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1.5px solid #3a3a3a; color: #fff; border-radius: 12px; height: 44px; padding: 0 32px 0 12px; font: 600 14px/1 system-ui, sans-serif; max-width: 58vw; }
body .calc-coef-wrap { display: flex; align-items: center; gap: 4px; }
body .calc-coef { width: 58px; text-align: center; }
body .calc-x { color: #8a8a8a; font-weight: 700; }
body .calc-broderie-real { font-size: 14px; font-weight: 600; color: #8a8a8a; white-space: nowrap; }
body .calc-broderie-round { font-size: 22px; font-weight: 800; color: #fff; }

body .calc-other-line { align-items: center; }
body .calc-other-input-wrap { display: flex; align-items: center; gap: 6px; }
body .calc-other { color: #fff; height: 30px; line-height: 30px; padding: 0 4px; }
body .calc-other:focus { border-bottom-color: #fff; }
body .calc-other::placeholder { color: #555; }
body .calc-da { color: #cfcfcf; }
body .calc-other-label, body .calc-total-label { color: #fff; }
body .calc-total-val { color: #fff; font-size: 26px; }

body .calc-add-btn { color: #fff; border-color: #444; }
body .calc-grand { background: #0f0f0f; border: 1px solid #2a2a2a; }
body .calc-grand-row span { color: #fff; }


/* ═══ CALCULATOR tidy-up (06/10): ONE clean top line, hint under its title ═══ */
body .calc-top-row { align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: nowrap; }
body .calc-currency-field { display: flex; flex-direction: row; align-items: center; gap: 8px; width: auto; flex: 0 0 auto; }
body .calc-currency-field label { margin: 0; white-space: nowrap; font-size: 13px; }
body .calc-currency-field select { width: 86px; flex: 0 0 auto; height: 44px; }
body .calc-share-top { height: 44px; }
body #calc-view label, body .calc-other-hint { text-align: left; }
body .calc-other-hint { margin-top: 2px; }
body .calc-thread { font-size: 13px; text-overflow: ellipsis; }


/* ===== PROFILE: no avatar colour picker any more ===== */
.avatar-colors { display: none !important; }

/* ===== PROFILE: tighter Notifications / Language rows ===== */
#view-about .notif-toggle-card { margin: 8px 16px; padding: 10px 16px; }
#view-about .profile-hero + .notif-toggle-card { margin-top: 16px; }

/* ===== PROFILE: Order book card (same family as the Pro card) ===== */
.ob-card { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px 16px; padding: 16px; text-align: start;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(224,168,71,.15)); border: 1px solid rgba(224,168,71,.25); border-radius: 14px;
  color: #FFF; font-family: 'Sora', sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ob-card:active { opacity: .85; }
.ob-ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ob-ico svg { width: 22px; height: 22px; color: #FFF; }
.ob-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ob-title { font-size: 16px; font-weight: 700; color: #FFF; }
.ob-sub { font-size: 12px; color: #999; }
.ob-count { background: #E5484D; color: #FFF; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.ob-count[hidden] { display: none !important; }
.ob-chev { width: 18px; height: 18px; color: #777; flex-shrink: 0; }
.ob-card[dir="rtl"] .ob-chev { transform: scaleX(-1); }
.nav-btn-profile { position: relative; }
.ob-dot { position: absolute; top: 6px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: #E5484D; border: 2px solid #0A0A0A; }
.ob-dot[hidden] { display: none !important; }
/* Order book in Arabic: back arrow + "+" button mirrored for RTL */
.cahier-view[dir="rtl"] .cah-topbar .back-btn svg { transform: scaleX(-1); }
.cahier-view[dir="rtl"] .cah-fab { right: auto; left: 20px; }


/* ===== VIEWER: file name under the title, 3D + Edits + Calculator on one line ===== */
.emb-title-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.emb-title-col .emb-tool-tag { margin-right: 0; line-height: 1.1; }
.emb-top-file { font-size: 11px; font-weight: 600; color: #7d8694; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.emb-stage .emb-tool-stack { top: 10px; }
.emb-canvas-actions { position: absolute; top: 10px; right: 10px; z-index: 4; height: 36px; display: flex; align-items: center; gap: 8px; }
.emb-canvas-actions .emb-canvas-calc { position: static; }
.emb-canvas-edits svg { width: 14px; height: 14px; flex-shrink: 0; }

/* EDITS (تعديلات): styles live in /static/js/edits.js */

/* ═══ v99 · VIEWER: THREAD 3D + FABRIC / COLOURS (19/10) ═══════════════════════════════════════════════════
   bottom bar = [Fabric][Colours]  ▶ Simulate  [Reset][Speed] · the colour line is gone: the progress fills
   the Simulate button · a strip of fabrics or palettes opens above the bar, scrolls sideways */
#emb-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none; }   /* no z-index: painted in page order, under the size / stitches / colours overlays */
#emb-gl.on { display: block; }
body .emb-btn-row { gap: 8px; margin: 6px 0 6px; }
body .emb-cbtn { padding: 8px 14px; }
body .emb-cbtn.emb-ic { flex: 0 0 auto; width: 44px; height: 42px; padding: 0; justify-content: center; border-radius: 12px; }
body .emb-cbtn.emb-ic svg { width: 19px; height: 19px; }
body .emb-cbtn.emb-ic.on { border-color: #fff; background: #2a2a2e; }
body .emb-cbtn.emb-play { height: 42px; background: linear-gradient(90deg, #d9d9dc var(--p, 0%), #fff var(--p, 0%)); }
.emb-fab-ic { width: 24px; height: 24px; border-radius: 7px; display: block; position: relative; background-color: #141416;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.10) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.emb-fab-ic::after { content: ""; position: absolute; inset: 3px; border-radius: 4px; border: 1.3px dashed rgba(255,255,255,.55); }
.emb-fab-ic.light::after { border-color: rgba(0,0,0,.45); }
.emb-col-ic { width: 25px; height: 25px; border-radius: 50%; display: block; position: relative;
  background: conic-gradient(#ff3b6b, #fbbf24, #a3e635, #22d3ee, #60a5fa, #c084fc, #ff3b6b); box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }
.emb-col-ic::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #1e1e20; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.emb-col-ic.spin { animation: embColSpin 1.7s cubic-bezier(.45,0,.2,1) 1; }
@keyframes embColSpin { 0% { transform: rotate(0) scale(1); } 45% { transform: rotate(400deg) scale(1.14); } 100% { transform: rotate(720deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .emb-col-ic.spin { animation: none; } }

body .emb-controls { position: relative; }
.emb-look { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 6; padding: 8px 12px 6px; background: #0c0c0d; border-top: 1px solid #222226; }
.emb-look-row { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 1px 4px; -webkit-overflow-scrolling: touch; }
.emb-look-row::-webkit-scrollbar { display: none; }
.emb-lk { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 68px; padding: 6px 4px 5px; border-radius: 12px;
  border: 1.5px solid #29292d; background: #151517; color: #cfcfd3; font-size: 10.5px; font-weight: 600; line-height: 1.15; font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.emb-lk.on { border-color: #fff; color: #fff; background: #222225; }
.emb-lk span { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emb-lk-sw { width: 54px; height: 34px; border-radius: 8px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.emb-lk-sw.weave { background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.09) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px); }
.emb-lk-sw.velvet { background-image: radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.20), transparent 60%); }
.emb-lk-sw.twill { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0 1px, transparent 1px 3px); }
.emb-lk-dots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; }
.emb-lk-dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.5), inset 0 1px 1px rgba(255,255,255,.45); }
.emb-lk-orig { background: conic-gradient(from 90deg, #3a3a3e, #1d1d20, #3a3a3e); }
.emb-lk-edit { width: 44px; justify-content: center; }
.emb-lk-col { position: relative; flex: 0 0 auto; width: 44px; height: 54px; border-radius: 12px; border: 1.5px solid #29292d; background: #151517; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.emb-lk-col b { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.emb-lk-col small { font-size: 9.5px; color: #8e8e93; font-variant-numeric: tabular-nums; }
.emb-lk-col input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.emb-look-hint { font-size: 10.5px; color: #77777c; margin: 2px 2px 0; }
/* v99: on a pale fabric (white, linen, blush) the stage's texts and buttons turn dark so they stay readable */
.emb-stage.emb-lightfab .emb-dims > div { color: #5b5650; text-shadow: none; }
.emb-stage.emb-lightfab .emb-dims > div > b { color: #1d1b18; }
.emb-stage.emb-lightfab .emb-dims .mac > span { color: #8a5d0c; }
.emb-stage.emb-lightfab .emb-dims .mac > b { color: #24456f; }
.emb-stage.emb-lightfab .emb-total { color: #1d1b18; text-shadow: none; }
.emb-stage.emb-lightfab .emb-total small { color: #6b655d; }
.emb-stage.emb-lightfab .emb-legend-title { color: #5b5650; }
.emb-stage.emb-lightfab .emb-legend-row span { color: #2a2724; }
.emb-stage.emb-lightfab .emb-legend-row .sw { border-color: rgba(0,0,0,.25); }
body .emb-stage.emb-lightfab .emb-canvas-calc { background: rgba(22,22,24,.78); border-color: rgba(0,0,0,.55); color: #fff; }

/* ═══ 29/10 · ONE top bar look (Viewer · Edits · Split · like the Designer): the other buttons dark, Export white ═══ */
.emb-open-top, .emb-export-btn { height: 36px; padding: 0 12px !important; border-radius: 10px; gap: 6px; white-space: nowrap; flex: 0 0 auto;
  font: 700 12.5px 'Sora', system-ui, sans-serif; }
.emb-open-top { background: #1b1b1f; border: 1px solid #2c2c31; color: #e6e6ea; }
body .emb-export-btn { background: #fff; border: 1px solid #fff; color: #111; font-weight: 800; font-size: 13.5px; }
.emb-open-top svg, .emb-export-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.emb-topbar-tools { gap: 6px; }

/* ═══ 30/10 · CALCULATOR v2 (his sketch): top bar = currency + Export · compact cards · ×1–×4 badge · other costs with examples · live quote ═══ */
.calc-topbar h2 { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-topbar { padding: 12px 12px 12px 14px; gap: 10px; }
.calc-cur-btn { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.calc-cur-btn span { font-weight: 800; }
.calc-cur-btn select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; cursor: pointer; font-size: 16px; }
body #calc-view .calc-body { padding: 12px 12px 110px; }
body #calc-view .calc-client { width: 100%; box-sizing: border-box; background: #161616; border: 1px solid #262626; border-radius: 12px; color: #fff;
  font: 500 15px 'Sora', system-ui, sans-serif; padding: 11px 14px; margin-bottom: 12px; outline: none; -webkit-appearance: none; }
body #calc-view .calc-client:focus { border-color: #fff; }
body #calc-view .calc-client::placeholder { color: #666; }
body #calc-view .calc-product { padding: 12px; margin-bottom: 12px; border-radius: 16px; }
.calc-row1 { display: flex; align-items: stretch; gap: 10px; margin-bottom: 10px; }
body #calc-view .calc-thumb { flex: 0 0 auto; width: 92px; height: auto; min-height: 92px; margin: 0; border-radius: 12px; border-width: 1.5px; }
body #calc-view .calc-thumb-empty svg { width: 26px; height: 26px; }
.calc-r1-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
body #calc-view .calc-product-head { margin: 0; gap: 8px; }
body #calc-view .calc-name { height: 42px; box-sizing: border-box; padding: 0 12px; font-size: 15px; }
body #calc-view .calc-remove { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; }
.calc-st-row { display: flex; align-items: center; gap: 6px; }
.calc-st-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
body #calc-view .calc-stitches { width: 100%; box-sizing: border-box; height: 42px; background: #161616; border: 1.5px solid #262626; border-radius: 10px; color: #fff;
  font: 700 15px 'Sora', system-ui, sans-serif; padding: 0 10px; outline: none; -webkit-appearance: none; }
body #calc-view .calc-stitches:focus { border-color: #fff; }
body #calc-view .calc-stitches::placeholder { color: #666; font-weight: 500; }
.calc-mult { position: absolute; top: -9px; right: -7px; min-width: 26px; height: 26px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
  border: 1.5px solid #3a3a3e; background: #0f0f10; color: #cfcfd3; font: 800 11.5px/1 'Sora', system-ui, sans-serif; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; z-index: 1; }
.calc-mult.on { background: #fff; color: #111; border-color: #fff; }
.calc-mult:active { transform: scale(.92); }
body #calc-view .calc-thread { flex: 0 1 auto; max-width: 112px; height: 42px; font-size: 12.5px; }
body #calc-view .calc-coef-wrap { flex: 0 0 auto; }
body #calc-view .calc-coef { width: 48px; height: 42px; box-sizing: border-box; padding: 0 4px; }
.calc-line { display: flex; align-items: center; min-height: 34px; }
.calc-l { font-size: 14px; font-weight: 600; color: #e6e6ea; white-space: nowrap; }
body #calc-view .calc-l .calc-broderie-real { font-size: 12px; font-weight: 500; color: #777; margin-inline-start: 4px; }
body #calc-view .calc-broderie-round { font-size: 18px; font-weight: 800; color: #fff; white-space: nowrap; }
body #calc-view .calc-other-line { margin-top: 4px; gap: 8px; }
.calc-ol-wrap { position: relative; flex: 1 1 auto; min-width: 0; height: 36px; }
body #calc-view .calc-other-label { width: 100%; height: 100%; box-sizing: border-box; background: transparent; border: 0; border-bottom: 1.5px dotted #3a3a3a;
  border-radius: 0; color: #fff; font: 600 14px 'Sora', system-ui, sans-serif; padding: 0 2px; outline: none; -webkit-appearance: none; }
body #calc-view .calc-other-label:focus { border-bottom: 1.5px solid #fff; }
.calc-ol-ph { position: absolute; inset: 0 2px; display: flex; align-items: center; gap: 4px; pointer-events: none; color: #6e6e74; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; }
.calc-ol-ph b { color: #e6e6ea; font-weight: 600; flex: 0 0 auto; }
.calc-ol-ex { font-style: normal; overflow: hidden; text-overflow: ellipsis; transition: opacity .35s, transform .35s; }
.calc-ol-ex.out { opacity: 0; transform: translateY(-5px); }
.calc-ol-ph.hide { display: none; }
body #calc-view .calc-other-input-wrap { flex: 0 0 auto; }
body #calc-view .calc-other { width: 78px; text-align: center; }
body #calc-view .calc-total-line { margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed #2c2c2f; }
body #calc-view .calc-total-val { font-size: 22px; }
body #calc-view .calc-add-btn { margin-bottom: 12px; padding: 13px; }
.calc-prev { margin-top: 6px; }
.calc-prev-h { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px; font-size: 13px; font-weight: 700; color: #e6e6ea; }
.calc-prev-tap { font-size: 12px; font-weight: 500; color: #777; }
.calc-prev-canvas { display: block; width: 100%; height: auto; border-radius: 12px; background: #fff; cursor: pointer; box-shadow: 0 0 0 1px #2a2a2a; }
.calc-prev-empty { padding: 28px 12px; text-align: center; color: #777; font-size: 13px; border: 1.5px dashed #2c2c2f; border-radius: 12px; }
/* 30/10 b · stitches get the full width; thread + coef sit on the embroidery price line; money always reads "1 100 DA" */
.calc-st-wrap { display: block; }
body #calc-view .calc-emb-line { gap: 6px; margin-top: 2px; }
body #calc-view .calc-emb-line .calc-dots { margin: 0 4px 5px; min-width: 10px; }
.calc-emb-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; flex: 0 0 auto; }
body #calc-view .calc-emb-val .calc-broderie-real { font-size: 11px; font-weight: 500; color: #6e6e74; }
body #calc-view .calc-broderie-round, body #calc-view .calc-broderie-real, body #calc-view .calc-total-val, body #calc-grand-total,
body #calc-view .calc-emb-val { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .calc-emb-val { align-items: flex-start; }
body #calc-view .calc-thread { flex: 0 1 auto; max-width: 130px; min-width: 0; }
body #calc-view .calc-coef-wrap { gap: 3px; }

/* ═══ 30/10 c · CALCULATOR v3 (his yellow lines): compact top · 2-column grid (thumbnail over the thread type, same width;
   name + stitches over the coefficient) · one money column so every currency sits under the one above · quote always at the
   bottom with a share icon in its top-right corner · the ×N count moved to the Viewer cards ═══ */
body #calc-view .calc-body { padding: 10px 12px 110px; }
body #calc-view .calc-client { height: 40px; padding: 0 12px; margin-bottom: 10px; font-size: 14px; }
body #calc-view .calc-product { padding: 10px; margin-bottom: 10px; }
.calc-grid { display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: 40px 40px 42px; gap: 8px; margin-bottom: 2px; }
body #calc-view .calc-grid .calc-thumb { grid-column: 1; grid-row: 1 / span 2; width: auto; height: auto; min-height: 0; margin: 0; }
body #calc-view .calc-grid .calc-product-head { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
body #calc-view .calc-grid .calc-name { flex: 1 1 auto; min-width: 0; height: 40px; margin: 0; }
body #calc-view .calc-grid .calc-remove { width: 40px; height: 40px; }
body #calc-view .calc-grid .calc-stitches { grid-column: 2; grid-row: 2; width: 100%; height: 40px; }
body #calc-view .calc-grid .calc-thread { grid-column: 1; grid-row: 3; width: 100%; max-width: none; min-width: 0; height: 42px; font-size: 13px;
  padding: 0 26px 0 10px; background-position: right 9px center; }
body #calc-view [dir="rtl"] .calc-grid .calc-thread { padding: 0 10px 0 26px; background-position: left 9px center; }
body #calc-view .calc-grid .calc-emb-line { grid-column: 2; grid-row: 3; margin: 0; min-height: 42px; gap: 0; }
body #calc-view .calc-grid .calc-coef-wrap { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
body #calc-view .calc-grid .calc-coef { width: 54px; height: 42px; padding: 0 4px; }
body #calc-view .calc-grid .calc-emb-line .calc-dots { margin: 0 8px 6px; min-width: 10px; }
/* the money column: same width, same end edge, on all three lines */
body #calc-view .calc-amt { flex: 0 0 auto; min-width: 118px; box-sizing: border-box; display: flex; justify-content: flex-end; direction: ltr; unicode-bidi: isolate; text-align: right; }
body #calc-view .calc-emb-val.calc-amt { flex-direction: column; align-items: flex-end; justify-content: center; }
body #calc-view .calc-other-input-wrap.calc-amt { width: 118px; align-items: baseline; gap: 5px; }
body #calc-view .calc-other-input-wrap.calc-amt .calc-other { flex: 1 1 auto; width: auto; min-width: 0; text-align: right; }
body #calc-view .calc-other-line { margin-top: 6px; }
body #calc-view .calc-total-val.calc-amt { white-space: nowrap; }
/* the quote: always last, share icon in its corner (placed on the black band by calcPreview) */
.calc-prev-box { position: relative; }
.calc-prev-share { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #111;
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.35); -webkit-tap-highlight-color: transparent; padding: 0; }
.calc-prev-share svg { width: 17px; height: 17px; }
.calc-prev-share:active { transform: scale(.92); }
/* Viewer: ×N on a chosen card (tap = ×1 → ×2 → ×3 → ×4) — the same motif counted several times in the calculator */
.emb-mult { display: none; position: absolute; top: 8px; left: 8px; z-index: 2; min-width: 32px; height: 26px; padding: 0 8px; box-sizing: border-box;
  border-radius: 999px; border: 1.5px solid #fff; background: rgba(0,0,0,.62); color: #fff; font: 800 12px/1 'Sora', system-ui, sans-serif;
  align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.emb-mult.on { background: #fff; color: #111; }
.emb-grid.selecting .emb-tile.sel .emb-mult { display: inline-flex; }
.emb-grid.selecting .emb-tile.sel .emb-tag { visibility: hidden; }
/* "4500×2+8900" always reads left → right (a number line), but sits on the Arabic side in Arabic */
body #calc-view [dir="rtl"] .calc-grid .calc-stitches { text-align: right; }
/* 30/10 d · thread type = text + chevron over an invisible select (the native select split «حرير» on Android) */
body #calc-view .calc-grid .calc-thread-box { grid-column: 1; grid-row: 3; position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 6px; height: 42px; padding: 0 10px; box-sizing: border-box; border: 1.5px solid #3a3a3a; border-radius: 12px; background: #161616; color: #fff; cursor: pointer; min-width: 0; }
body #calc-view .calc-thread-txt { flex: 1 1 auto; min-width: 0; font: 600 14px/1.2 'Tajawal', system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-align: start; }
[dir="ltr"] #calc-view .calc-thread-txt, body #calc-view [dir="ltr"] .calc-thread-txt { font-family: 'Sora', system-ui, sans-serif; font-size: 13px; }
body #calc-view .calc-thread-chev { flex: 0 0 12px; width: 12px; height: 8px; color: #fff; }
body #calc-view .calc-grid .calc-thread-box .calc-thread { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; padding: 0; border: 0;
  font-size: 16px; cursor: pointer; grid-column: auto; grid-row: auto; max-width: none; }
/* 02/11 · profile Settings heading (notifications · .mira copy · language) */
.pf-set-title { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700; color: #8a8a8a; letter-spacing: .02em; margin: 22px 20px -6px; }

/* 04/11 ANR fix: blur behind panels is re-computed on every frame of the simulation → weak GPUs freeze.
   LITE phones keep the dark see-through panels, without the blur. */
html.lite *, html.lite *::before, html.lite *::after { -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }

/* 07/11 · visitor's quote: invite to sign up so the workshop name prints on it */
.calc-prev-sign { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin: 0 0 10px;
  padding: 11px 12px; border: 1px solid #E0A847; border-radius: 12px; background: rgba(224,168,71,.10); color: #f3e3c3;
  font: inherit; font-size: 13px; font-weight: 600; text-align: start; cursor: pointer; }
.calc-prev-sign[hidden] { display: none; }
.calc-prev-sign .cps-b { flex: none; padding: 7px 12px; border-radius: 999px; background: #E0A847; color: #111; font-weight: 800; font-size: 12.5px; }
.calc-prev-sign:active { transform: scale(.98); }
