/* DPP GITEX demo · mobile-first app styles.
   Tokens and components ported from Gitex/design/screens/assets/screens.css (the screen reference). */

:root {
  --navy: #22407a; --navy-deep: #172a4d; --ink: #16233f; --ink-2: #4a5568; --muted: #7a8599;
  --line: #dfe5ee; --line-dash: #d5dce7; --bg: #f3f6fb; --card: #fff;
  --chip-bg: #e5edf8; --chip-ink: #2b4c8c;
  --green: #1e8e4e; --green-bg: #e6f4ec; --amber: #e8a300; --amber-bg: #fdf3dc; --amber-ink: #8a5a00;
  --red: #c0201e; --red-bg: #fce8e7; --blue-bg: #eaf1fb;
  --accused: #b4570f;
  --font: "Inter", "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-ar: "Noto Sans Arabic", "Inter", sans-serif;
  --col: 480px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea { font: inherit; color: inherit; }
[lang="ar"], .ar { font-family: var(--font-ar); direction: rtl; }
.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.w { stroke-width: 3; }
.hidden { display: none !important; }
.ml { margin-left: auto; }
.spread { display: flex; align-items: center; gap: 6px; }
.grow { flex: 1; }

/* ---------- Shell: one column on phones, rails on desks ---------- */
.shell { min-height: 100dvh; }
.rail { display: none; }
.col-main { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
@media (min-width: 768px) {
  body { background: #e4e9f1; }
  .col-main { max-width: var(--col); margin: 0 auto; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(22,35,63,.12); }
}
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: minmax(260px, 1fr) var(--col) minmax(300px, 1fr); gap: 24px; padding: 0 24px; max-width: 1480px; margin: 0 auto; }
  .col-main { margin: 0; }
  .rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100dvh; padding: 24px 0; overflow-y: auto; }
  .rail-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .rail .panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
  .rail .panel.fill { flex: 1; display: flex; flex-direction: column; min-height: 0; }
}

/* ---------- Header ---------- */
.app-head { position: sticky; top: 0; z-index: 20; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 10px; background: linear-gradient(180deg, #e9f0fa 0%, rgba(243,246,251,.96) 100%); backdrop-filter: blur(8px); text-align: center; }
.app-head .top { position: relative; display: flex; justify-content: center; min-height: 62px; }
.profile { position: absolute; left: 0; top: 4px; display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; text-align: left; max-width: 38%; }
.profile .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-bg); display: grid; place-items: center; color: var(--navy); flex: none; }
.profile b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile span { font-size: 10.5px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.bell { position: absolute; right: 0; top: 4px; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--navy); }
.bell.dot::after { content: ""; position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.bell.ring { animation: ring .9s ease 2; }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.lg { display: flex; flex-direction: column; align-items: center; user-select: none; -webkit-user-select: none; }
.lg img { height: 40px; }
.lg-ar { font-size: 9px; line-height: 1.15; color: #1d3b7a; font-weight: 700; direction: rtl; font-family: var(--font-ar); }
.lg-en { font-size: 6px; font-weight: 800; color: #1d3b7a; letter-spacing: .01em; font-family: "Times New Roman", serif; }
.app-head h2 { font-size: 21px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.app-head .sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.pdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.pdot.g { background: var(--green); } .pdot.a { background: #d99a00; } .pdot.r { background: var(--red); width: 9px; height: 9px; }

/* ---------- Step badge (PDF numbering) + flow button ---------- */
.stepbar { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; }
.stepbadge { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: var(--navy); min-width: 0; }
.stepbadge b { background: var(--navy); color: #fff; border-radius: 6px; padding: 3px 7px; white-space: nowrap; }
.stepbadge span { font-weight: 600; letter-spacing: 0; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-accused .stepbadge { color: var(--accused); } .side-accused .stepbadge b { background: var(--accused); }
.flowbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--navy); flex: none; }
@media (min-width: 1024px) { .flowbtn { display: none; } }

/* ---------- Content ---------- */
.content { flex: 1; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.screen-in { animation: screenIn .28s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 9px 4px; }
.stepper .st { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.stepper .st i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: #eef1f6; color: var(--muted); transition: background .3s, color .3s; }
.stepper .st + .st::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: #e3e8f0; transition: background .3s; }
.stepper .st.done::before, .stepper .st.on::before { background: var(--navy); }
.stepper .st.on { color: var(--ink); font-weight: 700; } .stepper .st.on i { background: #fff; border: 2px solid var(--navy); color: var(--navy); }
.stepper .st.done { color: var(--ink-2); } .stepper .st.done i { background: var(--navy); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; }
.card.tint { background: var(--blue-bg); border-color: #d6e2f3; }
.card.dark { background: var(--navy-deep); color: #fff; border: none; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card h3 { font-size: 15px; font-weight: 800; }
.card .h3l { font-size: 17px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--chip-ink); }
.meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ch { display: flex; align-items: center; gap: 9px; }
.icc { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-bg); color: var(--navy); display: grid; place-items: center; flex: none; }
.body { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.body.ink { color: var(--ink); }
.reason { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.reason b { color: var(--ink); }

.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line-dash); }
.check-row:last-child { border-bottom: none; }
.check-row .tm { margin-left: auto; color: var(--muted); font-size: 12px; }
.check-row.in { animation: rowIn .3s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.tick { width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
.tick.warn { background: var(--amber); } .tick.off { background: #d9dfe8; } .tick.navy { background: var(--navy); }
.tick.spin { background: none; border: 2px solid #d3dbe7; border-top-color: var(--navy); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap; line-height: 1.5; vertical-align: 1px; }
.chip.pop { animation: pop .35s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.navy { background: var(--navy); color: #fff; } .pill.red { background: var(--red-bg); color: var(--red); }
.pill.green { background: var(--green-bg); color: var(--green); } .pill.amber { background: var(--amber-bg); color: var(--amber-ink); }
.pill.grey { background: #eef1f6; color: var(--ink-2); }

.banner { display: flex; gap: 9px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }
.banner .i { margin-top: 1px; }
.banner.amber { background: var(--amber-bg); color: #5b4300; border: 1px solid #f1dca6; } .banner.amber .i { color: #c98a00; }
.banner.blue { background: #e9eff8; color: var(--ink); border: 1px solid #e0e8f4; } .banner.blue .i { color: var(--navy); }
.banner.green { background: var(--green-bg); color: #17663a; border: 1px solid #bfe3cc; align-items: center; }
.banner.navy { background: var(--navy); color: #fff; border-radius: 14px; }
.banner.red { background: var(--red-bg); color: #8e1715; border: 1px solid #f3c6c4; }

.kvs { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line-dash); }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--ink-2); }
.kv b { text-align: right; display: flex; align-items: center; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.kvcard { padding: 4px 14px; gap: 0; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 800; width: 100%; transition: transform .1s, background .2s, opacity .2s; text-align: center; }
.btn:active:not([disabled]) { transform: scale(.98); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.outline { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn[disabled] { background: #e6eaf1; color: #98a3b5; border-color: transparent; cursor: not-allowed; }
.duo { display: flex; gap: 10px; } .duo .btn { flex: 1; font-size: 14px; }
.note { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); text-align: center; }
.linkbtn { color: var(--navy); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* Checkbox rows */
.cbs { display: flex; flex-direction: column; }
.cbrow { display: flex; align-items: center; gap: 11px; font-size: 13px; padding: 9px 0; border-bottom: 1px dashed var(--line-dash); text-align: left; width: 100%; min-height: 44px; }
.cbs .cbrow:last-child { border-bottom: none; }
.cbx { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b7c2d3; background: #fff; color: #fff; display: grid; place-items: center; flex: none; transition: background .15s, border-color .15s; }
.cbx .i { opacity: 0; }
.on > .cbx, .cbrow[aria-checked="true"] .cbx { background: var(--navy); border-color: var(--navy); }
.cbrow[aria-checked="true"] .cbx .i { opacity: 1; }
.cbrow.boxed { background: #f5f7fb; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; line-height: 1.4; }

/* Radio options (payment method, return/refer) */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; text-align: left; width: 100%; transition: border-color .15s, background .15s; }
.opt .oi { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-bg); color: var(--navy); display: grid; place-items: center; flex: none; }
.opt b { display: block; font-size: 13.5px; } .opt small { font-size: 11.5px; color: var(--ink-2); }
.opt .rad { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b7c2d3; flex: none; }
.opt[aria-checked="true"] { border-color: var(--navy); background: #f7f9fd; }
.opt[aria-checked="true"] .rad { border: 6px solid var(--navy); }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reasons button { font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.reasons button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.field { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; background: #fff; resize: none; }
.field:focus { outline: 2px solid var(--navy); outline-offset: -1px; }
.label { font-size: 12px; font-weight: 700; color: var(--ink-2); }

/* Documents list */
.prog-h { display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 13px; border-bottom: 2px solid var(--line); }
.bar { flex: 1; height: 7px; border-radius: 4px; background: #e5e9f0; overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: var(--navy); border-radius: 4px; transition: width .6s ease; }
.bar.g i { background: var(--green); }
.docrow { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.docrow:first-of-type { border-top: none; }
.docrow.pending { background: #fff8e8; }
.dic { width: 34px; height: 34px; border-radius: 9px; background: var(--blue-bg); color: var(--navy); display: grid; place-items: center; flex: none; }
.dt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dt b { font-size: 13.5px; } .dt span { font-size: 11.5px; color: var(--ink-2); }
.rev { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--green); white-space: nowrap; }
.notop { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--amber-ink); white-space: nowrap; }

/* Dark document viewer */
.viewer { background: #1f2430; color: #fff; min-height: 100dvh; }
.viewer .app-head { background: #1f2430; }
.viewer-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; position: sticky; top: 0; background: #1f2430; z-index: 5; }
.vbtn { width: 38px; height: 38px; border-radius: 50%; background: #343a48; display: grid; place-items: center; flex: none; color: #fff; }
.vt { flex: 1; min-width: 0; display: flex; flex-direction: column; } .vt b { font-size: 14px; } .vt span { font-size: 11px; color: #b3b9c6; }
.viewer-scroll { margin: 0 14px; background: #fff; border-radius: 6px; color: #1d1d1d; height: calc(100dvh - 260px); min-height: 360px; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
.viewer-foot { padding: 12px 14px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 9px; }
.viewer-foot .note { color: #b3b9c6; }
.readpill { align-self: center; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: #343a48; color: #b3b9c6; transition: background .3s, color .3s; }
.readpill.done { background: #1e5a3a; color: #bff0d3; }
.viewer .btn.outline { background: transparent; color: #fff; border-color: #6b7487; }
.viewer .btn[disabled] { background: #343a48; color: #7d8597; }
.paper { padding: 22px 18px 28px; font-size: 13px; line-height: 1.6; position: relative; }
.paper h4 { text-align: center; font-size: 16px; font-weight: 700; }
.paper .ps { text-align: center; font-size: 12px; color: #666; }
.paper .wm { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #c0201e; border: 1.5px solid #c0201e; padding: 1px 6px; border-radius: 4px; opacity: .7; }
.paper p { margin-top: 10px; }
.paper .items { border-top: 1px dashed #999; border-bottom: 1px dashed #999; margin-top: 12px; padding: 6px 0; }
.paper .row { display: flex; justify-content: space-between; }
.paper .total { font-weight: 700; padding: 6px 0 9px; border-bottom: 2px solid #333; display: flex; justify-content: space-between; }
.paper .stamp { display: inline-block; margin-top: 18px; border: 3px solid #1e8e4e; color: #1e8e4e; font-weight: 900; letter-spacing: .12em; padding: 4px 12px; transform: rotate(-8deg); border-radius: 6px; }
.paper .sig { display: flex; justify-content: space-between; margin-top: 18px; }
.paper .endmark { text-align: center; color: #999; font-size: 11px; margin-top: 28px; }
.paper .cctv { background: #2d3340; color: #9aa3b5; border-radius: 4px; aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 11px; margin-top: 12px; position: relative; }
.paper .cctv::after { content: attr(data-ts); position: absolute; left: 8px; bottom: 6px; font-family: ui-monospace, monospace; font-size: 10px; color: #e6e9ef; }

/* Assistant conversation */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble-q { align-self: flex-end; max-width: 85%; background: var(--blue-bg); border-radius: 16px 16px 4px 16px; padding: 9px 13px; font-size: 13.5px; animation: rowIn .2s ease both; }
.bubble-a { align-self: flex-start; max-width: 94%; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 10px 13px; font-size: 13.5px; line-height: 1.55; }
.bubble-a .who { font-size: 11.5px; font-weight: 700; color: var(--navy); margin-bottom: 3px; display: flex; align-items: center; gap: 5px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { font-size: 12.5px; font-weight: 600; color: var(--navy); background: #fff; border: 1px solid #cfdaeb; border-radius: 999px; padding: 7px 12px; text-align: left; }
.composer { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 5px 5px 14px; }
.composer input { flex: 1; min-width: 0; border: none; outline: none; font-size: 14px; background: none; padding: 7px 0; }
.composer .send { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; }
.chat-foot { font-size: 11px; color: var(--muted); text-align: center; }
.dots { display: inline-flex; gap: 4px; padding: 6px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #9fb0cc; animation: dot 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.caret::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--navy); opacity: .6; animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.thinking-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }

/* Tab bar */
.tabbar { position: sticky; bottom: 0; z-index: 15; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(8px + var(--safe-b)); }
.tabbar .tabs { display: flex; justify-content: space-around; }
.tabbar .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--ink-2); flex: 1; min-height: 44px; }
.tabbar .tab .ic { width: 46px; height: 28px; border-radius: 14px; display: grid; place-items: center; }
.tabbar .tab.on { color: var(--navy); font-weight: 700; } .tabbar .tab.on .ic { background: var(--blue-bg); }
.tabbar .legal { text-align: center; font-size: 10px; color: var(--muted); margin-top: 3px; }

/* ---------- Overlays: sheets, modal, toasts, push banner ---------- */
.dim { position: fixed; inset: 0; background: rgba(15,22,40,.45); z-index: 40; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; margin: 0 auto; max-width: var(--col); background: #fff; border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 11px; max-height: 92dvh; overflow-y: auto; animation: up .3s cubic-bezier(.2,.9,.3,1) both; box-shadow: 0 -10px 40px rgba(15,22,40,.2); }
.sheet.tall { height: 92dvh; }
.sheet.closing { animation: down .22s ease both; } .dim.closing { animation: fade .22s ease reverse both; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #d5dbe5; align-self: center; flex: none; }
.sheet h3 { font-size: 18px; font-weight: 800; }
.sheet .sh-head { display: flex; align-items: center; gap: 10px; }
.sheet .x { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: #f0f3f8; display: grid; place-items: center; flex: none; }
.sheet .chat-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(15,22,40,.55); animation: fade .2s ease both; }
.modal .box { background: #fff; border-radius: 22px; padding: 24px 20px; width: min(340px, 100%); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; animation: pop .3s ease both; }
.modal .box h3 { font-size: 17px; }
.modal .box p { font-size: 13px; color: var(--ink-2); }
.modal .ring-spin { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #e1e7f0; border-top-color: var(--navy); animation: spin .9s linear infinite; }
.modal .ok { width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; animation: pop .35s cubic-bezier(.3,1.6,.5,1) both; }
.modal .brand { font-weight: 900; letter-spacing: .06em; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.modal .sim { font-size: 10.5px; color: var(--muted); }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(90px + var(--safe-b)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up2 .25s ease both; max-width: 440px; }
@keyframes up2 { from { opacity: 0; transform: translateY(10px); } }
.push { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 70; width: min(440px, calc(100% - 16px)); display: flex; gap: 11px; align-items: center; text-align: left; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 18px; padding: 11px 13px; box-shadow: 0 14px 40px rgba(15,22,40,.25); animation: pushIn .45s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes pushIn { from { transform: translate(-50%, -140%); } }
.push img { width: 38px; height: 38px; border-radius: 10px; background: #fff; border: 1px solid var(--line); object-fit: contain; padding: 3px; flex: none; }
.push b { display: block; font-size: 13px; } .push span { font-size: 12.5px; color: var(--ink-2); }
.push small { margin-left: auto; align-self: flex-start; font-size: 11px; color: var(--muted); }

/* Flow map (PDF step structure) */
.flowmap { display: flex; flex-direction: column; gap: 6px; }
.fm-side { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-top: 6px; }
.fm-side.member { color: var(--navy); } .fm-side.accused { color: var(--accused); }
.fm-step { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: start; }
.fm-num { font-size: 11px; font-weight: 800; color: #fff; background: var(--navy); border-radius: 6px; padding: 4px 0; text-align: center; margin-top: 3px; }
.accused .fm-num, .fm-step.accused .fm-num { background: var(--accused); }
.fm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fm-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-align: left; }
.fm-chip.done { color: var(--green); border-color: #bfe3cc; background: #f3faf6; }
.fm-chip.cur { border: 2px solid var(--navy); color: var(--navy); font-weight: 800; background: #f4f7fc; }
.accused .fm-chip.cur, .fm-step.accused .fm-chip.cur { border-color: var(--accused); color: var(--accused); background: #fdf6f0; }
.fm-chip.branch { border-style: dashed; }
.fm-chip.taken { box-shadow: inset 0 0 0 1px currentColor; }
.fm-chip.other { opacity: .75; }
.fm-label { font-size: 11px; font-weight: 800; color: var(--ink-2); width: 100%; margin-top: 2px; }
.fm-hand { margin: 4px 0; padding: 7px 10px; border-radius: 10px; background: #fff7ef; color: var(--accused); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.fm-hand.done { background: var(--green-bg); color: var(--green); }
.fm-tools { display: flex; gap: 8px; margin-top: 10px; }
.fm-tools .btn { min-height: 38px; font-size: 12.5px; }

/* Landing */
.landing { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.landing .box { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.landing h1 { font-size: 22px; font-weight: 800; }
.landing p { color: var(--ink-2); font-size: 13.5px; }
.landing .role { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line); text-align: left; text-decoration: none; color: inherit; }
.landing .role b { display: block; font-size: 16px; } .landing .role span { font-size: 12.5px; color: var(--ink-2); }
.landing .role .n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.popin { display: inline-block; animation: pop .35s cubic-bezier(.3,1.6,.5,1) both; }
.viewer .stepbadge span { color: #b3b9c6; }
.viewer .stepbadge b { background: #3a4a72; }
.viewer .flowbtn { background: #343a48; border-color: #343a48; color: #fff; }
/* Segmented control (Arabic original / English) */
.seg { display: flex; gap: 4px; background: #eef1f6; border-radius: 10px; padding: 3px; }
.seg button { flex: 1; font-size: 12.5px; font-weight: 700; padding: 8px 6px; border-radius: 8px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(22,35,63,.12); }
.ordertext { font-size: 13px; line-height: 1.7; color: var(--ink); background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.amount { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.card.dark .eyebrow { color: #9fb6e0; } .card.dark small { color: #c7d2e8; font-size: 12px; }
.orow { display: flex; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-dash); }
.orow:last-child { border-bottom: none; }
.empty { align-items: center; text-align: center; padding: 28px 18px; gap: 8px; }
.empty .big { width: 64px; height: 64px; border-radius: 50%; background: var(--blue-bg); color: var(--navy); display: grid; place-items: center; }
.notice-new { border: 2px solid var(--accused); background: #fffaf5; text-align: left; width: 100%; animation: pop .4s ease both; }
.codebox { display: flex; gap: 6px; justify-content: center; }
.codebox span { width: 40px; height: 48px; border: 1.5px solid var(--line); border-radius: 10px; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: #fff; }
.codebox span.f { border-color: var(--navy); }
/* Fill the column so the tab bar sits at the bottom on short screens */
.col-main > .screen-in { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.viewer > .screen-in { min-height: 100dvh; }
/* Keep the profile pill clear of the centred logo on narrow phones */
.lg { width: 92px; }
.profile { max-width: calc(50% - 50px); }
.profile > div:last-child { min-width: 0; }
.profile b { font-size: 12px; letter-spacing: -.01em; }
.profile span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .profile .avatar { display: none; }
  .profile { padding: 5px 11px; max-width: calc(50% - 27px); }
  .lg { width: 84px; }
}
.lg, .lg-en { white-space: nowrap; }
@media (max-width: 420px) { .lg { width: auto; } }

/* ---------- Mirror mode (inside the stand screen) ---------- */
body.mirror { pointer-events: none; user-select: none; -webkit-user-select: none; }
body.mirror::-webkit-scrollbar, body.mirror *::-webkit-scrollbar { display: none; }
html:has(body.mirror) { scrollbar-width: none; }
.tapdot { position: fixed; z-index: 99; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(34,64,122,.28); border: 2px solid rgba(34,64,122,.55); pointer-events: none; animation: tapdot .7s ease-out both; }
@keyframes tapdot { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.mirror-wait { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; color: var(--ink-2); }
.mirror-wait img { height: 64px; opacity: .8; }
.mirror-wait b { font-size: 17px; color: var(--ink); }
.mirror-wait span { font-size: 13px; }

/* ---------- Link flag (one linked device per phone drives the stand) ---------- */
.linkflag { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.linkflag i { width: 7px; height: 7px; border-radius: 50%; background: #a8b2c3; }
.linkflag.on { background: var(--green-bg); color: var(--green); }
.linkflag.on i { background: var(--green); box-shadow: 0 0 0 3px rgba(30,142,78,.18); }
.viewer .linkflag { background: #343a48; color: #b3b9c6; } .viewer .linkflag.on { background: #1e5a3a; color: #bff0d3; }
@media (max-width: 380px) { .stepbadge span { display: none; } }
