/* ==========================================================================
   TENON — espace client « Mon meuble » (français / arabe)
   Plein écran sous 640 px, téléphone encadré au-delà, texte de démo à gauche dès 1100 px.
   ========================================================================== */

:root { --ar-sans: "IBM Plex Sans Arabic", "Inter Tight", system-ui, sans-serif; --ar-serif: "Amiri", "Cormorant Garamond", serif; }
html, body { height: 100%; }
body.cl { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; overflow: clip; background: var(--sand); }
.cl .demo-bar { flex: none; }
.stage { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--linen); }
.pitch { display: none; }

.app { --app-sans: var(--sans); --app-serif: var(--serif); position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--linen); color: var(--ink); font-family: var(--app-sans); font-size: 15px; line-height: 1.45; overflow: hidden; overflow: clip; }
.app[lang="ar"] { --app-sans: var(--ar-sans); --app-serif: var(--ar-serif); }
.app[lang="ar"] em { font-style: normal; }
.app[lang="ar"] .k, .app[lang="ar"] .kicker { letter-spacing: 0; text-transform: none; font-family: var(--ar-sans); font-size: 12.5px; }
.amt, .ltr { unicode-bidi: isolate; direction: ltr; white-space: nowrap; display: inline-block; }

/* En-tête */
.ah { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 12px; background: var(--ink); color: var(--paper); }
.ah__brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ah__mark { width: 34px; height: 34px; flex: none; padding: 4px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(201, 162, 90, .35); }
.ah__brand b { display: block; font-family: var(--app-serif); font-weight: 400; font-size: 23px; line-height: 1; }
.app[lang="ar"] .ah__brand b { font-weight: 700; font-size: 21px; }
.ah__brand small { display: block; margin-top: 4px; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--brass-2); white-space: nowrap; }
.app[lang="ar"] .ah__brand small { font: 500 12px/1.2 var(--ar-sans); letter-spacing: 0; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(251, 248, 243, .08); box-shadow: inset 0 0 0 1px rgba(251, 248, 243, .14); direction: ltr; flex: none; }
.lang button { min-width: 50px; height: 40px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: rgba(251, 248, 243, .7); }
.lang button[lang="ar"] { font-family: var(--ar-sans); font-size: 15px; }
.lang button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

/* Écran */
.screen { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }
.view { padding: 0 16px 28px; animation: view-in .45s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.k { font: 500 10.5px/1.25 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.h2 { margin: 24px 2px 12px; font-family: var(--app-serif); font-weight: 400; font-size: 27px; line-height: 1.05; font-variant-numeric: lining-nums; }
.app[lang="ar"] .h2 { font-weight: 700; font-size: 23px; line-height: 1.35; }
.card { padding: 16px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }

/* Suivi : le meuble et la phrase d'état */
.hero { margin: 0 -16px; padding: 14px 16px 18px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.hero__hello { font-size: 13.5px; color: var(--muted); }
.hero__fig { height: 230px; margin: 6px -6px 4px; }
.hero__fig svg { width: 100%; height: 100%; }
.hero__name { font: 500 12px/1.4 var(--mono); color: var(--brass-ink); letter-spacing: -.01em; }
.app[lang="ar"] .hero__name { font-family: var(--ar-sans); font-size: 13px; }
.hero__st { margin: 8px 0 0; font-family: var(--app-serif); font-size: 25px; line-height: 1.15; font-variant-numeric: lining-nums; }
.app[lang="ar"] .hero__st { font-weight: 700; font-size: 21px; line-height: 1.55; }
.hero__note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: rgba(79, 122, 87, .12); color: #2f5136; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.hero__note .ico { width: 18px; height: 18px; flex: none; }
.hero__st.is-new { animation: st-in 1.2s var(--ease); }
@keyframes st-in { 0% { color: var(--brass-ink); } }

/* Frise des étapes (pas une liste numérotée) */
.steps { display: flex; gap: 0; margin: 18px -16px 0; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.steps::-webkit-scrollbar { display: none; }
.stp { position: relative; flex: 0 0 96px; padding-top: 22px; scroll-snap-align: center; }
.stp::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--sand-2); }
.stp:first-child::before { left: 50%; }
.stp:last-child::before { right: 50%; }
[dir="rtl"] .stp:first-child::before { left: 0; right: 50%; }
[dir="rtl"] .stp:last-child::before { right: 0; left: 50%; }
.stp.is-done::before, .stp.is-now::before { background: var(--brass); }
.stp i { position: absolute; top: 1px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--linen); border: 2px solid var(--sand-2); }
.stp.is-done i { background: var(--brass); border-color: var(--brass); }
.stp.is-now i { background: var(--paper); border: 4px solid var(--brass); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(176, 135, 58, .45); } 70% { box-shadow: 0 0 0 10px rgba(176, 135, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(176, 135, 58, 0); } }
.stp b { display: block; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.2; padding: 0 4px; }
.stp span { display: block; margin-top: 3px; text-align: center; font: 500 10.5px/1.3 var(--mono); color: var(--muted); }
.app[lang="ar"] .stp span { font-family: var(--ar-sans); font-size: 11.5px; }
.stp.is-now b, .stp.is-next b { color: var(--brass-ink); }
.stp.is-next i { background: var(--paper); border: 4px solid var(--brass); }

.prep { margin-top: 16px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.prep .ico { color: var(--brass-ink); margin-top: 3px; }
.prep h3 { margin: 0 0 6px; font-size: 16px; }
.prep p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.prep small { display: block; font: 500 11.5px/1.4 var(--mono); color: var(--brass-ink); }
.app[lang="ar"] .prep small { font-family: var(--ar-sans); font-size: 12.5px; }

/* Paiements */
.sum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.sum .card { padding: 14px; }
.sum b { display: block; margin-top: 6px; font: 500 18px/1.1 var(--mono); letter-spacing: -.02em; }
.sum .is-rest { grid-column: 1 / -1; background: var(--ink); color: var(--paper); box-shadow: none; }
.sum .is-rest .k { color: var(--brass-2); }
.sum .is-rest b { font-family: var(--serif); font-size: 32px; font-weight: 400; font-variant-numeric: lining-nums; }
.nofee { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 13px; font-weight: 600; color: var(--ok); }
.parts { margin: 0; padding: 0; list-style: none; }
.parts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 13px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.parts li:last-child { border-bottom: 0; }
.parts b { font-size: 14.5px; }
.parts small { display: block; font-size: 12.5px; color: var(--muted); }
.parts .amt { font: 500 14px/1 var(--mono); letter-spacing: -.02em; }
.parts .tag { grid-column: 1 / -1; justify-self: start; }
.receipts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.receipts li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.receipts .ico { color: var(--brass-ink); }
.receipts b { display: block; font-size: 14px; }
.receipts small { display: block; font-size: 12px; color: var(--muted); }
.modes { display: flex; flex-wrap: wrap; gap: 6px; }

/* Devis */
.dv__fig { height: 300px; margin: 8px -8px 0; }
.dv__fig svg { width: 100%; height: 100%; }
.lines { margin: 0; padding: 0; list-style: none; }
.lines li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.lines li span { min-width: 0; color: var(--ink-2); }
.lines li .amt { font: 500 13px/1.4 var(--mono); letter-spacing: -.02em; }
.lines li.is-total { border-bottom: 0; font-weight: 600; font-size: 15px; }
.lines li.is-total .amt { font-size: 15px; }
.debit { margin-top: 12px; display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.debit .ico { color: var(--brass-ink); }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rules li { padding: 10px 12px; border-radius: 12px; background: var(--brass-soft); color: var(--brass-ink); font-size: 13.5px; }
.ind { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* Notifications façon téléphone */
.pushes { position: absolute; z-index: 30; top: 70px; left: 10px; right: 10px; display: grid; gap: 8px; pointer-events: none; }
.push { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 12px; border-radius: 18px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule), 0 24px 50px -20px rgba(35, 28, 22, .55); pointer-events: auto; animation: push-in .55s var(--ease); }
.push svg { width: 34px; height: 34px; padding: 5px; border-radius: 9px; background: var(--ink); }
.push small { display: block; font: 500 10.5px/1.2 var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.app[lang="ar"] .push small { font-family: var(--ar-sans); letter-spacing: 0; font-size: 11.5px; }
.push p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.35; }
.push.is-out { opacity: 0; transform: translateY(-10px); transition: .35s; }
@keyframes push-in { from { opacity: 0; transform: translateY(-16px) scale(.98); } }

/* Barre d'onglets */
.tabs { flex: none; display: flex; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--rule); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; border-radius: 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tabs button[aria-current="true"] { color: var(--ink); }
.tabs button[aria-current="true"] .ico { color: var(--brass-ink); }
.app[lang="ar"] .tabs button { font-size: 12.5px; }

/* Téléphone encadré, puis texte de démo à côté */
@media (min-width: 640px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 430px) minmax(0, 1fr); align-items: center; padding: 22px 24px; background: radial-gradient(800px 520px at 50% 110%, rgba(176, 135, 58, .16), transparent 62%), var(--sand); }
  .app { grid-column: 2; height: min(100%, 880px); border: 10px solid #1b1511; border-radius: 52px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 50px 90px -40px rgba(35, 28, 22, .6); }
  .ah { padding-top: 18px; }
}
@media (min-width: 1100px) {
  .pitch { display: block; grid-column: 1; align-self: center; justify-self: end; max-width: 380px; margin-right: 56px; }
  .pitch__t { margin: 14px 0 14px; font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: -.01em; }
  .pitch__t em { color: var(--walnut); }
  .pitch__l { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
  .pitch__b { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
  .pitch__b li { padding-left: 18px; position: relative; font-weight: 600; font-size: 14.5px; }
  .pitch__b li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
}
.is-embed .demo-bar, .is-embed .pitch { display: none !important; }
.is-embed .stage { display: flex; padding: 0; background: var(--linen); }
.is-embed .app { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }

.app[lang="ar"] .tag { font-family: var(--ar-sans); letter-spacing: 0; font-size: 12.5px; }
/* la frise défile : un fondu aux bords plutôt qu'une étiquette coupée net */
.steps { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%); }
