/* The approved look (Figma SPNQJzYvjsHtBAl6JsLwSM): cream page, raised warm-white cards, espresso active states, gold accents.
   Phone: one column with a floating bottom bar. Desktop (1024+): a floating side rail and wider grids. RTL-first. */

:root { --pad: 18px; }
body { background: var(--page); font-size: 15px; line-height: 21px; font-weight: 400; }
b, strong, h1, h2, h3 { font-weight: 500; }
.demo-banner { font-size: var(--fs-xs); background: var(--brand-accent-soft); color: var(--ink-2); }
small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }

/* Shell */
.shell { display: block; padding-bottom: 96px; }
.main { min-width: 0; }
.content { width: 100%; max-width: 480px; margin-inline: auto; padding: 24px var(--pad) 0; }
.topbar { position: relative; display: block; width: 100%; max-width: 480px; height: 0; min-height: 0; padding: 0; margin: 0 auto; border: 0; background: none; box-shadow: none; overflow: visible; z-index: 5; }
.topbar.scrolled { background: none; box-shadow: none; }
.menu-btn, .btn.menu-btn, .topbar-mark, .topbar .search-trigger, .topbar-spacer { display: none !important; }
.topbar .bell, .topbar .btn.bell { position: absolute; top: 24px; inset-inline-end: var(--pad); display: grid; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--lift-sm); }
.topbar .bell-count { position: absolute; inset: -3px -3px auto auto; display: block; width: auto; min-width: 18px; height: 18px; padding: 0 4px; border: 0; border-radius: 9px; background: var(--terracotta); color: #fff; font-size: 11px; font-weight: 500; line-height: 18px; text-align: center; }
.topbar .bell-count[hidden] { display: none; }
body[data-route="person"] .topbar .bell, body[data-route="notifications"] .topbar .bell, body[data-route="chat"]:has(.has-open) .topbar .bell, body[data-route="files"]:has(.hero-card, .in-file) .topbar .bell { display: none; }

/* Floating navigation */
.sidebar { position: fixed; inset: auto 12px 12px 12px; top: auto; z-index: 50; display: flex; flex-direction: row; align-items: center; gap: 2px; width: auto; max-width: 456px; height: 62px; margin-inline: auto; padding: 6px; border: 0; border-radius: 31px; background: var(--surface); box-shadow: var(--shadow-lg); transform: none; visibility: visible; overflow: visible; }
.sidebar .nav { display: flex; flex-direction: row; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 0; padding: 0; }
.sidebar .nav > a, .rail-pop > summary { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 40px; min-width: 40px; height: 44px; padding: 0; border-radius: 22px; background: none; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; }
.rail-pop > summary::-webkit-details-marker { display: none; }
.sidebar .nav > a span, .rail-pop > summary > span:not(.persona):not(.avatar) { display: none; }
.sidebar .nav > a svg, .rail-pop > summary svg { flex: none; color: inherit; stroke: currentColor; opacity: 1; }
.sidebar .nav > a:hover, .rail-pop > summary:hover { background: var(--hover); color: var(--ink); }
.sidebar .nav > a[aria-current="page"], .sidebar .nav > a[aria-current="page"]:hover, #rail-more > summary.on, #rail-more > summary.on:hover { width: auto; min-width: 0; height: 50px; padding: 0 14px; border-radius: 25px; background: var(--brand); color: var(--brand-ink); box-shadow: var(--lift-dark); }
.sidebar .nav > a[aria-current="page"] span, #rail-more > summary.on > span { display: inline; }
.sidebar .count, .sidebar .nav > a .count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 16px; height: 16px; margin: 0; padding: 0 4px; border-radius: 8px; background: var(--terracotta); color: #fff; font-size: 10px; font-style: normal; line-height: 16px; text-align: center; }
.sidebar .count b { font-weight: 500; }
.rail-pop { position: relative; }
.rail-me { flex: none; margin: 0; }
.rail-me > summary { width: 44px; min-width: 44px; padding: 0; }
.rail-me .persona { display: block; padding: 0; border: 0; }
.rail-me .persona-text { display: none; }
.rail-me .avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-accent-soft); color: var(--ink-2); font-size: 15px; font-weight: 500; }
.rail-menu { position: absolute; bottom: calc(100% + 10px); inset-inline-end: 0; z-index: 40; display: grid; gap: 2px; width: 240px; padding: 8px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); }
.rail-menu a, .rail-new { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--ink-2); font-size: 15px; text-align: start; text-decoration: none; cursor: pointer; }
.rail-menu a:hover, .rail-new:hover { background: var(--hover); color: var(--ink); }
.rail-menu a[aria-current="page"] { background: var(--brand-accent-soft); color: var(--ink); }
.rail-menu .count { position: static; }
.persona-switch { padding: 8px; }
.persona-switch label { display: block; margin-bottom: 4px; font-size: 13px; color: var(--ink-3); }
.persona-switch select { width: 100%; }

/* Shared pieces */
.page-head { display: block; margin: 0 0 16px; padding-inline-end: 56px; }
.page-head h1, .day-head h1, .req-page h1 { margin: 0; font-size: 36px; font-weight: 500; line-height: 46px; color: var(--ink); }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 21px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: 16px; }
.top-row + .page-head { padding-inline-end: 0; }
.round-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--lift-sm); text-decoration: none; cursor: pointer; }
.round-btn:hover { background: #fff; }
.round-btn.dark { background: var(--brand); color: var(--brand-ink); box-shadow: var(--lift-dark); }
.round-btn.dark:hover { background: var(--espresso-2); }
.round-btn.sm { width: 36px; height: 36px; }
.round-btn.recording { background: var(--terracotta); color: #fff; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: var(--brand-accent-soft); color: var(--ink); font-size: 15px; font-weight: 500; line-height: 20px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.pill-btn:hover { background: #e7d7b8; }
.pill-btn.white { background: var(--surface); box-shadow: var(--lift-sm); }
.pill-btn.white:hover { background: #fff; }
.pill-btn.dark { background: var(--brand); color: var(--brand-ink); box-shadow: var(--lift-dark); }
.pill-btn.dark:hover { background: var(--espresso-2); }
.pill-btn:disabled { opacity: .45; box-shadow: none; cursor: default; }
.big-action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 62px; border: 0; border-radius: 31px; background: var(--brand); color: var(--brand-ink); font-size: 17px; font-weight: 500; text-decoration: none; box-shadow: var(--lift-dark); cursor: pointer; }
.big-action:hover { background: var(--espresso-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions.tight { flex-wrap: nowrap; margin: 0; }
.panel { display: block; padding: 16px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--lift); text-align: start; text-decoration: none; }
a.panel:hover, button.panel:hover { background: #fff; }
.panel h3, .panel .draft-title { margin: 0 0 8px; font-size: 17px; font-weight: 500; line-height: 24px; }
.stack { display: grid; gap: 12px; }
.stack.tight { gap: 8px; }
.card-grid { display: grid; gap: 12px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 24px; max-width: 100%; padding: 0 10px; border-radius: 12px; background: var(--brand-accent-soft); color: var(--ink); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.late { background: var(--terracotta); color: #fff; }
.chip.gold { background: var(--brand-accent); color: var(--ink); }
.chip.olive { background: var(--olive-soft); color: var(--olive); }
.avatar-c { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-accent-soft); color: var(--ink-2); font-size: 17px; font-weight: 500; }
.avatar-c.sm { width: 36px; height: 36px; font-size: 15px; }
.eyebrow { display: block; margin: 0 0 6px; color: var(--ink-3); font-size: 13px; font-weight: 400; line-height: 18px; }
.section-title { margin: 20px 0 8px; color: var(--ink-3); font-size: 14px; font-weight: 400; }
.empty-line { margin: 16px 0; color: var(--ink-3); }
.hint { margin: 8px 0 0; color: var(--ink-3); font-size: 13px; line-height: 19px; }
.warn-line { margin: 8px 0 0; color: var(--late); font-size: 13px; line-height: 19px; }
.quiet-link { display: block; margin: 20px auto 0; padding: 8px; border: 0; background: none; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.text-filters { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0 12px; }
.text-filters button, .text-filters a { padding: 2px 0; border: 0; background: none; color: var(--ink-3); font-size: 15px; text-decoration: none; cursor: pointer; }
.text-filters .red { color: var(--late); }
.text-filters .on { color: var(--ink); font-weight: 500; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; color: var(--ink); text-decoration: none; }
.line b { display: block; font-size: 16px; font-weight: 500; line-height: 22px; }
.line small { display: -webkit-box; color: var(--ink-3); -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line .chip { flex: none; max-width: 45%; }
a.line:hover b { color: var(--espresso-2); text-decoration: underline; text-underline-offset: 3px; }
.line-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.line-foot small { flex: none; color: var(--ink-3); }
.person-head { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.person-head b { display: block; font-size: 17px; font-weight: 500; line-height: 23px; }
.person-head small { display: block; color: var(--ink-3); }
.hero-card { padding: 22px; border-radius: 24px; background: var(--brand); color: var(--brand-accent-soft); box-shadow: 0 12px 26px rgba(107, 82, 43, .26); }
.hero-card h2 { margin: 0 0 8px; color: var(--brand-accent); font-size: 28px; font-weight: 500; line-height: 38px; }
.hero-card p { margin: 0; line-height: 22px; }
.hero-card.small { padding: 14px 18px; }
.hero-card.small h2 { margin: 0; font-size: 26px; }
.example { width: 100%; cursor: pointer; font-size: 15px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; }
.goal { margin: 0 0 8px; }
.goal small { display: block; color: var(--ink-3); }
.text-danger { padding: 4px; border: 0; background: none; color: var(--late); cursor: pointer; }
.field-input { width: 100%; padding: 14px 16px; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--lift); font: inherit; resize: vertical; outline: 0; }
.field-input:focus { box-shadow: 0 0 0 2px var(--focus); }

/* يومك */
.day-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.day-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.day-tools { display: flex; width: 100%; gap: 8px; }
.day-tools .pill-btn { flex: 1 1 0; }
.with-icon { gap: 8px; }
.tl-section + .tl-section { margin-top: 20px; }
.tl-section .section-title { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.tl-section .section-title span { color: var(--ink-3); font-weight: 400; }
.summary-card .sum-late + .sum-late { margin-top: 10px; }
.req-progress { margin: 16px 0; padding: 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--lift-sm); }
.req-progress p { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
.req-progress p b { color: var(--ink); font-weight: 500; }
.req-steps { display: flex; margin: 0; padding: 0; list-style: none; }
.req-steps li { position: relative; flex: 1 1 0; min-width: 0; color: var(--ink-3); font-size: 13px; line-height: 18px; text-align: center; }
.req-steps li::before { content: ""; position: absolute; top: 11px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--brand-accent-soft); }
.req-steps li:last-child::before { display: none; }
.req-steps li.done::before { background: var(--brand); }
.req-steps i { position: relative; display: grid; place-items: center; width: 24px; height: 24px; margin: 0 auto 6px; border-radius: 50%; background: var(--brand-accent-soft); color: var(--brand-ink); }
.req-steps .done i { background: var(--brand); }
.req-steps .now i { background: var(--brand-accent); box-shadow: 0 0 0 4px var(--brand-accent-soft); }
.req-steps .done, .req-steps .now { color: var(--ink); }
.req-steps .now { font-weight: 500; }
.more-actions > summary { list-style: none; cursor: pointer; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions[open] { flex-basis: 100%; }
.more-actions[open] > .actions { margin-top: 8px; }
.day-layout { display: grid; gap: 14px; }
.summary-card { padding: 16px 18px; border-radius: 24px; background: var(--brand); color: var(--brand-accent-soft); box-shadow: 0 12px 26px rgba(107, 82, 43, .26); }
.sum-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sum-top b { color: var(--brand-accent); font-size: 34px; font-weight: 500; line-height: 42px; }
.sum-top span { font-size: 14px; }
.sum-bar { height: 8px; margin: 10px 0 12px; border-radius: 4px; background: var(--espresso-2); overflow: hidden; }
.sum-bar i { display: block; height: 100%; border-radius: 4px; background: var(--brand-accent); }
.sum-late { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font-size: 15px; cursor: pointer; text-align: start; }
.sum-calm { margin: 0; font-size: 14px; }
.side-people { display: none; }
.day-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.day-pill { display: grid; justify-items: center; gap: 1px; min-width: 0; padding: 12px 2px; border: 0; border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--lift-sm); cursor: pointer; }
.day-pill small { font-size: 12px; line-height: 17px; color: var(--ink-2); white-space: nowrap; }
.day-pill b { font-size: 17px; line-height: 22px; font-weight: 500; }
.day-pill.on { background: var(--brand); color: var(--brand-ink); box-shadow: var(--lift-dark); }
.day-pill.on small { color: var(--brand-accent-soft); }
.tl { display: grid; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
.tl-when { padding-top: 12px; }
.tl-when b { display: block; font-size: 17px; font-weight: 500; line-height: 21px; }
.tl-when small { display: block; color: var(--ink-3); font-size: 13px; }
.tl-when.late b { color: var(--late); }
.tl-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--lift); text-decoration: none; }
.tl-card:hover { background: #fff; }
.tl-text { flex: 1; min-width: 0; }
.tl-text > b { display: block; font-size: 17px; font-weight: 500; line-height: 24px; }
.tl-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.tl-sub small { min-width: 0; color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub .chip { flex: none; }

/* صفحة الطلب */
.req-page h1 { font-size: 32px; line-height: 42px; }
.req-facts { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0; }
.req-facts small { display: block; color: var(--ink-3); font-size: 13px; }
.req-facts .big { display: block; font-size: 28px; font-weight: 500; line-height: 36px; }
.req-facts .red { color: var(--late); }
.req-facts .who { text-align: end; }
.req-facts .who > a, .req-facts .who > span { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--ink); text-decoration: none; }
.req-block { margin-bottom: 16px; }
.req-block p { margin: 0; }
.update { padding: 12px 14px; border-radius: 18px; }
.update time { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.req-note { margin: 16px 0; color: var(--ink-2); }
.req-main { margin-top: 20px; }

/* Bottom sheets */
dialog.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 480px; max-height: 92dvh; margin: 0 auto; padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); border: 0; border-radius: 26px 26px 0 0; background: var(--surface-2); color: var(--ink); overflow-y: auto; }
dialog.sheet::backdrop { background: var(--overlay); }
.sheet-grip { width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--brand-accent-soft); }
dialog.sheet h2 { margin: 0 0 12px; font-size: 28px; font-weight: 500; line-height: 38px; }
.sheet-input { display: block; width: 100%; padding: 14px 16px; border: 0; border-radius: 20px; background: var(--brand-accent-soft); color: var(--ink); font: inherit; resize: none; outline: 0; }
.sheet-input.one { min-height: 48px; padding-block: 0; border-radius: 22px; margin-top: 10px; }
.sheet-input:focus { box-shadow: 0 0 0 2px var(--focus); }
.sheet-input::placeholder, .field-input::placeholder { color: var(--ink-3); }
.sheet-field { margin-bottom: 12px; }
.sheet-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.sheet-field .one { margin-top: 0; }
.sheet-field small { display: block; margin-top: 4px; color: var(--ink-3); }
.check-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheet-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sheet-note { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; }
.sheet-row .sheet-note { margin: 0; text-align: center; }
.sheet-error { margin: 8px 0 0; color: var(--late); font-size: 14px; }
.understood { margin-top: 10px; padding: 10px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--lift-sm); }
.understood small { display: block; margin-bottom: 6px; color: var(--ink-3); }
.understood .chips + .chips { margin-top: 6px; }
.step-title { margin: 14px 0 8px; font-size: 16px; font-weight: 500; }
.pick-row { display: flex; gap: 8px; padding: 2px 2px 8px; margin-inline: -2px; overflow-x: auto; scrollbar-width: none; }
.pick-row.wrap { flex-wrap: wrap; overflow: visible; }
.pick { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--lift-sm); font: inherit; white-space: nowrap; cursor: pointer; }
.pick.on { background: var(--brand); color: var(--brand-ink); box-shadow: var(--lift-dark); }
.pick.day { display: grid; justify-items: center; width: 82px; min-height: 70px; padding: 8px 0; border-radius: 22px; }
.pick.day small { font-size: 12px; color: var(--ink-2); }
.pick.day.on small { color: var(--brand-accent-soft); }
.pick.day b { font-size: 17px; font-weight: 500; }
.pick.other { position: relative; overflow: hidden; }
.pick.other input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* للاعتماد والمتابعة */
.draft .quote { margin: 0 0 6px; color: var(--ink-3); font-size: 13px; line-height: 19px; }
.follow-item { padding-top: 12px; }
.follow-item .line { padding: 0; }
.follow-item .actions { margin-top: 8px; }
.follow-item .hint { margin-top: 4px; }

/* الشات */
.chat-layout { display: grid; gap: 12px; }
.thread { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; }
.thread.on { background: var(--brand-accent-soft); }
.thread b { display: block; font-size: 16px; font-weight: 500; line-height: 22px; }
.thread small { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-end { flex: none; display: grid; justify-items: end; gap: 4px; }
.thread-end time { color: var(--ink-3); font-size: 12px; }
.thread-end em { min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-style: normal; line-height: 18px; text-align: center; }
.conversation { display: flex; flex-direction: column; gap: 10px; }
.chat-layout .conversation { padding: 0; background: none; box-shadow: none; min-height: calc(100dvh - 150px); }
.conv-head { display: flex; align-items: center; gap: 10px; }
.conv-head b { display: block; font-size: 17px; font-weight: 500; line-height: 22px; }
.conv-head small { display: block; color: var(--ink-3); }
.segmented-pill { flex: none; display: flex; padding: 4px; border-radius: 22px; background: var(--brand-accent-soft); }
.segmented-pill a { padding: 5px 14px; border-radius: 18px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.segmented-pill a[aria-current] { background: var(--brand); color: var(--brand-ink); }
.messages { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 120px; overflow-y: auto; padding: 4px 2px; }
.msg { align-self: flex-end; max-width: 82%; padding: 10px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--lift-sm); }
.msg.me { align-self: flex-start; background: var(--brand); color: var(--brand-ink); }
.msg small { display: block; color: var(--ink-3); font-size: 12px; }
.msg span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.msg.me time { color: var(--brand-accent-soft); }
.pending-note { display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px; border-radius: 16px; background: var(--brand-accent-soft); font-size: 13px; }
.pending-note small { color: var(--ink-2); }
.pending-note[hidden] { display: none; }
.private-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; background: var(--brand); color: var(--brand-accent-soft); }
.private-note svg { flex: none; color: var(--brand-accent); }
.private-note p { margin: 0; font-size: 13px; line-height: 19px; }
.composer-pill { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 28px; background: var(--surface); box-shadow: var(--lift); }
.composer-pill textarea { flex: 1; min-width: 0; padding: 10px 10px; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; resize: none; }
.composer-pill .round-btn { box-shadow: none; }
@media (max-width: 1023px) {
  .chat-layout.has-open .chat-list, body[data-route="chat"]:has(.has-open) .chat-title { display: none; }
  .chat-layout .composer-pill { position: sticky; bottom: 84px; }
}
.in-file { gap: 8px; }
.in-file .messages { max-height: 280px; min-height: 40px; }

/* الملفات */
.file-card { display: block; }
.file-top { display: flex; align-items: center; gap: 12px; }
.file-top b { display: block; font-size: 17px; font-weight: 500; line-height: 23px; }
.file-top small { display: block; color: var(--ink-3); }
.file-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--brand-accent-soft); }
.attach-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 0; border: 0; background: none; color: var(--ink); text-align: start; cursor: pointer; }
.attach-row b { display: block; font-weight: 500; }
.attach-row small { display: block; color: var(--ink-3); }

/* الناس */
.pp-card.inactive { opacity: .6; }
.pp-card .line-foot { margin-top: 12px; }

/* السجل */
.search-pill { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 28px; background: var(--surface); box-shadow: var(--lift); }
.search-pill input { flex: 1; min-width: 0; padding: 0 12px; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; }

/* الإشعارات */
.notif-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 20px; cursor: pointer; }
.notif-row b { display: block; font-weight: 500; }
.notif-row small { display: block; color: var(--ink-3); }
.notif-row time { flex: none; color: var(--ink-3); font-size: 12px; }
.notif-row.read b { font-weight: 400; color: var(--ink-2); }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-accent); }
.dot.late { background: var(--terracotta); }
.dot.olive { background: var(--olive); }

/* مهامي */
.my-hero { padding: 18px; border-radius: 24px; background: var(--brand); color: var(--brand-accent-soft); box-shadow: 0 12px 26px rgba(107, 82, 43, .26); margin-bottom: 12px; }
.my-hero small { display: block; font-size: 13px; }
.my-hero h2 { margin: 6px 0 8px; color: var(--brand-accent); font-size: 28px; font-weight: 500; line-height: 38px; }
.my-hero a.title { color: inherit; text-decoration: none; }
.my-hero .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.my-hero .go { display: flex; align-items: center; justify-content: center; min-height: 54px; margin-top: 14px; border-radius: 27px; background: var(--brand-accent); color: var(--ink); font-size: 17px; font-weight: 500; text-decoration: none; }
.my-hero .go:hover { background: #cfae69; }
.task-page { max-width: 760px; }
.task-page .card { border: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--lift); }

/* Older pages inherit the same surfaces */
.card { border: 0; border-radius: 22px; box-shadow: var(--lift); }
.btn { border-radius: var(--r-pill); font-weight: 500; }
.input, .select, .textarea { border-radius: 14px; }
.toasts { bottom: 88px; }

@media (min-width: 640px) and (max-width: 1023px) {
  .content, .topbar { max-width: 600px; }
  .sidebar { max-width: 560px; }
}
@media (min-width: 1024px) {
  :root { --pad: 32px; }
  .shell { padding: 0 128px 48px 0; }
  .content, .topbar { max-width: 1120px; }
  .content { padding-top: 32px; }
  .topbar .bell, .topbar .btn.bell { top: 32px; }
  .sidebar { inset: 50% 20px auto auto; flex-direction: column; width: 76px; height: auto; max-width: none; margin: 0; padding: 8px; gap: 4px; border-radius: 38px; transform: translateY(-50%); }
  .sidebar .nav { flex-direction: column; width: 100%; gap: 4px; }
  .sidebar .nav > a, #rail-more > summary, .sidebar .nav > a[aria-current="page"], .sidebar .nav > a[aria-current="page"]:hover, #rail-more > summary.on, #rail-more > summary.on:hover { flex-direction: column; gap: 2px; width: 60px; min-width: 0; height: 60px; padding: 0; border-radius: 22px; font-size: 12px; }
  .sidebar .nav > a span, #rail-more > summary > span { display: inline; }
  .rail-menu, #rail-more .rail-menu, .rail-me .rail-menu { inset: auto calc(100% + 14px) 0 auto; }
  body[data-route="memory"] .content, body[data-route="meeting"] .content, body[data-route="request"] .content, body[data-route="notifications"] .content { max-width: 720px; }
  body[data-route="memory"] .topbar, body[data-route="meeting"] .topbar, body[data-route="request"] .topbar, body[data-route="notifications"] .topbar { max-width: 720px; }
  .page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-inline-end: 0; }
  .page-actions { margin: 0 0 0 56px; }
  .day-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
  .day-side { grid-column: 2; grid-row: 1; display: grid; gap: 14px; position: sticky; top: 24px; }
  .day-main { grid-column: 1; grid-row: 1; }
  .side-people { display: block; }
  .side-person { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink); text-decoration: none; }
  .side-person b { display: block; font-size: 16px; font-weight: 500; line-height: 22px; }
  .side-person small { display: block; color: var(--ink-3); }
  .day-pill { padding: 16px 2px; }
  .tl-card { justify-content: space-between; padding: 14px 16px; }
  .tl-sub { display: contents; }
  .tl-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
  .tl-text > b { grid-column: 1; }
  .tl-sub small { grid-column: 1; grid-row: 2; }
  .tl-sub .chip { grid-column: 2; grid-row: 1 / span 2; }
  .tl-row { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chat-layout { grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 16px; }
  .chat-list { max-height: 76vh; overflow-y: auto; padding: 8px; margin: -8px; }
  .chat-back { display: none; }
  .chat-layout .conversation { padding: 16px; border-radius: 24px; background: var(--surface); box-shadow: var(--lift); min-height: 0; height: 76vh; }
  .chat-layout .composer-pill { background: var(--brand-accent-soft); box-shadow: none; }
  .chat-layout .msg:not(.me) { background: var(--brand-accent-soft); box-shadow: none; }
  dialog.sheet { inset: 0; width: 480px; height: fit-content; margin: auto; border-radius: 26px; }
  .sheet-grip { display: none; }
  .toasts { bottom: 24px; }
}

/* Sign-in */
body.signed-out .shell, body.signed-out .toasts { display: none; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--pad); }
.login-card { width: 100%; max-width: 420px; display: grid; gap: 12px; padding: 28px; border-radius: 24px; background: var(--surface); box-shadow: var(--lift); }
.login-card h1 { margin: 0; font-size: 28px; font-weight: 500; line-height: 38px; }
.login-card p { margin: 0; color: var(--ink-2); }
.login-card label { font-size: 14px; font-weight: 500; }
.login-card .one { margin: 0; }

@media (min-width: 768px) {
  .day-tools { width: auto; padding-inline-end: 52px; }
  .day-tools .pill-btn { flex: none; }
}

.recording-pill { align-items: center; padding-inline-end: 6px; }
.recording-pill .round-btn:not(.dark) { background: none; color: var(--ink-2); }
.rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--terracotta); animation: rec-pulse 1.2s ease-in-out infinite; }
.recording-pill.paused .rec-dot, .recording-pill.failed .rec-dot { animation: none; }
.rec-time { flex: none; font-variant-numeric: tabular-nums; direction: ltr; }
.rec-label { min-width: 0; color: var(--ink-3); font-size: 13px; }
.recording-pill.failed .rec-label { color: var(--terracotta); }
@keyframes rec-pulse { 50% { opacity: .35; } }
.msg .voice-player { display: flex; align-items: center; gap: 8px; min-width: min(250px, 60vw); }
.msg .voice-player .round-btn { width: 36px; height: 36px; background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.msg.me .voice-player .round-btn { background: var(--brand-accent); color: var(--brand); }
.voice-player [aria-busy="true"] { opacity: .6; }
.voice-bar { --p: 0%; flex: 1; min-width: 60px; height: 24px; margin: 0; background: none; cursor: pointer; appearance: none; -webkit-appearance: none; }
.voice-bar::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to left, var(--brand) var(--p), var(--line-strong) var(--p)); }
.voice-bar::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to left, var(--brand) var(--p), var(--line-strong) var(--p)); }
.voice-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--brand); }
.voice-bar::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--brand); }
.msg.me .voice-bar::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--brand-accent) var(--p), rgb(255 255 255 / .28) var(--p)); }
.msg.me .voice-bar::-moz-range-track { background: linear-gradient(to left, var(--brand-accent) var(--p), rgb(255 255 255 / .28) var(--p)); }
.msg.me .voice-bar::-webkit-slider-thumb { background: var(--brand-accent); }
.msg.me .voice-bar::-moz-range-thumb { background: var(--brand-accent); }
.voice-time { flex: none; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; direction: ltr; }
.voice-speed { flex: none; min-width: 34px; min-height: 28px; padding: 2px 6px; border: 0; border-radius: 14px; background: var(--brand-accent-soft); color: var(--brand); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; }
.msg.me .voice-speed { background: rgb(255 255 255 / .16); color: var(--brand-ink); }
.msg .voice-text { margin-top: 6px; font-size: 13px; line-height: 1.6; }
.msg .voice-note { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.voice-transcribe { display: block; min-height: 32px; margin-top: 4px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 16px; background: none; color: inherit; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.voice-transcribe:disabled { opacity: .6; cursor: default; }
.msg.me .voice-transcribe { border-color: rgb(255 255 255 / .28); }
.msg.me .voice-note { color: var(--brand-accent-soft); }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.composer-pill:focus-within, .search-pill:focus-within { box-shadow: 0 0 0 2px var(--focus), var(--lift); }

/* Comfortable targets for fingers, and inputs at 16px so phones don't zoom on focus. */
@media (pointer: coarse), (max-width: 767px) {
  html { scroll-padding-bottom: 104px; }
  input, select, textarea { font-size: 16px; }
  .text-filters { gap: 4px 14px; margin: 8px 0 6px; }
  .text-filters button, .text-filters a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
  .sum-late, a.line, .quiet-link, .legend-link, .check-line { min-height: 44px; }
  .quiet-link { display: flex; align-items: center; justify-content: center; }
  .summary-card .sum-late + .sum-late { margin-top: 0; }
  .legend-link { display: inline-flex; align-items: center; }
  .round-btn.sm { width: 44px; height: 44px; }
  .composer-pill textarea, .search-pill input { min-height: 44px; }
  .input, .select, select, input[type="text"], input[type="date"], input[type="email"] { min-height: 44px; }
  .check-line { margin-bottom: 4px; }
  .rail-pop a, .rail-pop button { min-height: 44px; }
}

/* The notice runs under the rail too, so it reads as one band across the page. */
@media (min-width: 1024px) {
  .demo-banner { margin-inline-start: -128px; }
}

/* Overview and requests, in the approved look. */
.ov-top { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.ov-hero-head { display: flex; align-items: center; gap: 12px; min-height: 44px; color: inherit; text-decoration: none; }
.ov-links { display: grid; gap: 4px 24px; margin-top: 8px; }
.ov-hero a.sum-late { display: flex; min-height: 44px; text-decoration: none; color: inherit; }
.ov-stat { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
a.ov-stat:hover { background: #fff; }
.ov-stat small { color: var(--ink-2); font-size: 14px; }
.ov-stat b { font-size: 34px; font-weight: 500; line-height: 42px; }
.ov-stat span { color: var(--ink-3); font-size: 13px; line-height: 18px; }
.attn li > a { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
.attn .attn-side { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; width: max-content; max-width: 180px; overflow: visible; }
.attn .attn-side .chip { flex: none; max-width: none; white-space: nowrap; }
.dept-list { display: grid; }
.dept-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.dept-row:hover { background: var(--hover); }
.dept-name b { display: block; font-size: 16px; font-weight: 500; }
.dept-name small, .dept-rate small { color: var(--ink-3); font-size: 13px; }
.dept-rate { display: flex; align-items: baseline; gap: 6px; }
.dept-rate b { font-size: 16px; font-weight: 500; }
.scope-tabs.segmented { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; padding: 0; border: 0; background: none; box-shadow: none; }
.scope-tabs [role="radio"] { min-height: 44px; padding: 0 2px; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-3); font-size: 15px; }
.scope-tabs [role="radio"][aria-checked="true"] { background: none; box-shadow: none; color: var(--ink); font-weight: 500; }
.scope-tabs .n { min-width: 0; padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.orders-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.orders-tools .search-pill { flex: 1 1 100%; min-width: 0; }
.orders-tools .select { flex: 1 1 140px; width: auto; min-height: 44px; border: 0; border-radius: 22px; background-color: var(--surface); box-shadow: var(--lift-sm); }
.orders-tools .segmented { flex: none; }
.result-count { margin: 14px 0 0; color: var(--ink-3); font-size: 13px; text-align: center; }
#results .tl-sub { flex-wrap: wrap; }
.ticket { border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--lift); }
.lane { border: 0; border-radius: 22px; background: var(--brand-accent-soft); }
.drawer-id { color: var(--ink-3); font-size: 13px; }
.drawer .btn { min-height: 44px; }
.mono { font-family: inherit; letter-spacing: 0; }
@media (min-width: 768px) {
  .ov-top { grid-template-columns: repeat(3, 1fr); }
  .ov-hero { grid-column: 1 / -1; }
  .ov-links { grid-template-columns: repeat(3, 1fr); }
  .dept-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 90px; align-items: center; gap: 20px; }
  .dept-rate { justify-content: flex-end; }
  .orders-tools .search-pill { flex: 2 1 280px; }
  .drawer { border-start-start-radius: 28px; border-end-start-radius: 28px; }
}

.sum-late .chip { flex: none; }

@media (max-width: 380px) {
  .day-pill { padding-inline: 2px; }
  .day-pill small { font-size: 12px; white-space: nowrap; }
}

/* Phone, from Figma page «03 · الموبايل»: a fixed labelled tab bar, list rows instead of big cards, one main action per item. */
.tabbar, .phone-only { display: none; }
.msg-queued { display: flex; align-items: center; gap: 4px; align-self: flex-start; margin: -2px 2px 2px; color: var(--olive); font-size: 12px; line-height: 16px; }
.more-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 16px; text-align: start; text-decoration: none; cursor: pointer; }
@media (max-width: 767px) {
  :root { --pad: 16px; }
  .desk-only { display: none !important; }
  .phone-only { display: revert; }
  .shell { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .content { padding-top: calc(18px + env(safe-area-inset-top)); }
  .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .tabbar { position: fixed; inset: auto 0 0 0; z-index: 50; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 48px; padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 12px; line-height: 16px; text-decoration: none; cursor: pointer; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar [aria-current="page"], .tabbar .on { color: var(--ink); font-weight: 700; }
  .tabbar em { position: absolute; top: -2px; inset-inline-end: calc(50% - 26px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--terracotta); color: #fff; font-size: 11px; font-style: normal; font-weight: 500; line-height: 18px; text-align: center; }
  .topbar .bell, .topbar .btn.bell { top: calc(18px + env(safe-area-inset-top)); }

  .page-head { min-height: 44px; margin-bottom: 12px; }
  .page-head .page-actions { margin-inline-end: -56px; }
  body[data-route="notifications"] .page-head .page-actions { margin-inline-end: 0; }
  .day-main, .day-side { min-width: 0; }
  body[data-route="chat"]:has(.has-open) .demo-banner { display: none; }
  .page-head h1, .day-head h1 { font-size: 24px; font-weight: 700; line-height: 32px; }
  .page-head p, .day-head p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 18px; }
  .page-actions { margin-top: 10px; }
  .page-actions .pill-btn.dark { width: 100%; }
  .pill-btn { min-height: 40px; padding: 0 16px; border-radius: 20px; font-size: 14px; }
  .panel { padding: 14px; border-radius: 20px; }
  .panel h3, .panel .draft-title { margin-bottom: 4px; font-size: 16px; line-height: 22px; font-weight: 700; }
  .card-grid { gap: 12px; }
  .chip { min-height: 22px; padding: 0 9px; font-size: 12px; }
  .chip.late { background: #f4ddd0; color: var(--terracotta); }
  .chip.gold { background: #f3e5c4; color: #6e5420; }
  .more-actions { margin-inline-start: auto; }
  .more-actions > summary { width: 40px; min-width: 40px; padding: 0; border-radius: 50%; background: var(--page); }
  .more-actions[open] { display: contents; }
  .more-actions[open] > summary { margin-inline-start: auto; background: var(--brand-accent-soft); }
  .more-actions[open] > .actions { flex-basis: 100%; margin-top: 0; }

  /* الرئيسية */
  .day-head { display: block; margin-bottom: 14px; padding-inline-end: 56px; }
  .day-tools { position: fixed; bottom: calc(82px + env(safe-area-inset-bottom)); inset-inline-end: 16px; z-index: 40; width: auto; }
  .day-tools .pill-btn { flex: none; min-height: 46px; border-radius: 23px; font-weight: 700; }
  body[data-route="today"] .shell, body[data-route="home"]:has(.day-page) .shell { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .day-layout { gap: 12px; }
  .summary-card { padding: 14px 16px; border-radius: 20px; }
  .sum-top { flex-direction: row-reverse; align-items: center; }
  .sum-top b { font-size: 24px; font-weight: 700; line-height: 30px; }
  .sum-bar { height: 6px; margin: 8px 0 10px; }
  .summary-card .sum-late, .summary-card .sum-calm { display: none; }
  .sum-brief.phone-only { display: flex; align-items: center; gap: 7px; }
  .sum-brief { margin: -4px 0 -6px; }
  .sum-brief button { min-height: 36px; padding: 0; border: 0; background: none; color: var(--brand-ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
  .sum-brief .late { color: #f0b79f; }
  .day-pill { gap: 0; padding: 7px 0; border-radius: 16px; }
  .day-pill small { font-size: 11px; line-height: 15px; color: var(--ink-3); }
  .day-pill b { font-size: 16px; font-weight: 700; line-height: 20px; }
  .day-pill .day-n { display: none; }
  .day-dot.phone-only { display: block; width: 5px; height: 5px; margin-top: 2px; border-radius: 50%; background: var(--ink-3); visibility: hidden; }
  .day-dot.has { visibility: visible; }
  .day-pill.on .day-dot { background: var(--brand-accent); }
  .text-filters { flex-wrap: nowrap; gap: 8px; margin: 12px calc(var(--pad) * -1); padding: 2px var(--pad); overflow-x: auto; scrollbar-width: none; }
  .text-filters::-webkit-scrollbar { display: none; }
  .text-filters button, .text-filters a { flex: none; min-height: 36px; padding: 0 13px; border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 13px; white-space: nowrap; }
  .text-filters .red { color: var(--ink); }
  .text-filters .on { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
  .tl-group { border-radius: 20px; background: var(--surface); box-shadow: var(--lift); overflow: hidden; }
  .tl-group .tl-section + .tl-section { margin-top: 0; border-top: 1px solid var(--line); }
  .tl-group .section-title { display: none; }
  .tl-group .tl { gap: 0; }
  .tl-group .tl-row { display: block; }
  .tl-group .tl-row + .tl-row { border-top: 1px solid var(--line); }
  .tl-group .tl-when, .tl-group .avatar-c { display: none; }
  .tl-group .tl-card { padding: 11px 14px; border-radius: 0; background: none; box-shadow: none; }
  .tl-group .tl-sub { display: contents; }
  .tl-group .tl-text { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
  .tl-group .tl-text > b { grid-column: 1; font-size: 15px; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tl-group .tl-sub small { grid-column: 1; grid-row: 2; color: var(--ink-3); font-size: 12.5px; line-height: 18px; }
  .tl-group .tl-sub .chip { grid-column: 2; grid-row: 1 / span 2; }

  /* المحادثات */
  .chat-layout .chat-list { gap: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--lift); overflow: hidden; }
  .chat-list .thread { gap: 11px; padding: 10px 12px; border-radius: 0; background: none; box-shadow: none; }
  .chat-list .thread + .thread { border-top: 1px solid var(--line); }
  .chat-list .avatar-c { width: 46px; height: 46px; font-size: 16px; font-weight: 700; }
  .chat-list .avatar-c.dark { background: var(--brand); color: var(--brand-accent); }
  .chat-list .thread b { font-size: 15.5px; line-height: 21px; }
  .chat-list .thread small { color: var(--ink-3); font-size: 13px; line-height: 18px; }
  .thread-end em { background: var(--terracotta); color: #fff; }
  body[data-route="chat"]:has(.has-open) .tabbar { display: none; }
  body[data-route="chat"]:has(.has-open) .shell { padding-bottom: 0; }
  body[data-route="chat"]:has(.has-open) .content { padding: 0; }
  .chat-layout.has-open { display: block; }
  .chat-layout.has-open .conversation { height: 100dvh; min-height: 0; gap: 0; border-radius: 0; }
  .chat-layout.has-open .conv-head { flex: none; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .chat-layout.has-open .conv-head b { font-size: 16px; font-weight: 700; line-height: 21px; }
  .chat-layout.has-open .conv-head small { font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-layout.has-open .chat-back { width: 40px; height: 40px; box-shadow: none; }
  .chat-layout.has-open .messages { min-height: 0; padding: 14px 16px; gap: 8px; }
  .chat-layout.has-open .private-note, .chat-layout.has-open .pending-note { flex: none; margin: 8px 12px 0; }
  .chat-layout.has-open .composer-pill { position: static; flex: none; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); box-shadow: none; }
  .chat-layout.has-open .composer-pill:focus-within { box-shadow: none; }
  .chat-layout.has-open .composer-pill textarea { padding: 10px 16px; border-radius: 22px; background: var(--page); }
  .chat-layout.has-open > .conversation > .actions { flex: none; margin: 0; padding: 0 12px 8px; background: var(--surface); }

  /* قائمة الاعتماد */
  .draft .quote { display: none; }
  .draft-src.phone-only { display: block; margin: 0 0 8px; color: var(--ink-3); font-size: 12.5px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .draft .warn-line { margin-top: 6px; font-size: 12.5px; line-height: 18px; }
  .draft .actions { align-items: center; margin-top: 10px; }

  /* المتابعة */
  .follow-group.panel { padding: 0; overflow: hidden; }
  .follow-group .person-head { padding: 10px 14px; background: #fbf5e8; }
  .follow-group .person-head > span:nth-child(2) { flex: 1; min-width: 0; }
  .follow-group .person-head b { font-size: 15px; font-weight: 700; line-height: 20px; }
  .follow-group .person-head small { font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .follow-group .avatar-c { width: 38px; height: 38px; font-size: 15px; font-weight: 700; }
  .person-late.phone-only { display: inline; color: var(--terracotta); font-size: 12.5px; font-weight: 500; }
  .follow-item { padding: 11px 14px 9px; border-top: 1px solid var(--line); }
  .follow-item .line { align-items: flex-start; min-height: 0; }
  .follow-item .line b { font-size: 15px; line-height: 21px; }
  .follow-item .actions { align-items: center; }
  .follow-item .pill-btn.dark { background: var(--brand-accent-soft); color: var(--ink); box-shadow: none; }
  .follow-item .more-actions .pill-btn.white { background: var(--page); box-shadow: none; }
  .follow-group[hidden], .follow-item[hidden] { display: none; }
}
