/* El Bab – dashboard for investors and agents (after login).
   Builds on base.css tokens; mirrors the app mockups: cream canvas, white
   cards, navy feature cards, gold actions. Logical properties for RTL. */

.dash { background: var(--cream); min-height: 100vh; }
.dash-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

/* Sidebar */
.dash-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 1.1rem; background: var(--paper); border-inline-end: 1px solid var(--line); }
.dash-side .wordmark { padding-inline: .6rem; }
.dash-role { display: inline-flex; align-items: center; gap: .4rem; margin-inline: .6rem; padding: .3rem .75rem; border-radius: 999px; background: var(--gold-soft); color: var(--navy); font-size: .75rem; font-weight: 600; width: fit-content; }
.dash-role.is-pro { background: var(--navy); color: var(--gold); }
.dash-nav { display: grid; gap: .15rem; }
.dash-nav a { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 8px; text-decoration: none; color: var(--navy); font-size: .95rem; }
.dash-nav a:hover { background: var(--cream); color: var(--navy); }
.dash-nav a[aria-current="page"] { background: var(--navy); color: var(--cream); }
.dash-nav a[aria-current="page"] .icon { color: var(--gold); }
.dash-nav .icon { width: 20px; height: 20px; color: var(--gold-deep); }
.dash-count { margin-inline-start: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.4rem; }
.dash-side-foot { margin-top: auto; display: grid; gap: .6rem; padding-inline: .6rem; font-size: .85rem; }
.dash-side-foot form { margin: 0; }
.dash-side-foot .link-button { color: var(--muted); }
.dash-langs { display: flex; gap: .4rem; flex-wrap: wrap; }
.dash-langs a { padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .8rem; }
.dash-langs a[aria-current] { border-color: var(--navy); background: var(--navy); color: var(--cream); }

/* Main column */
.dash-main { min-width: 0; padding: 1.75rem clamp(1rem, 3vw, 2.75rem) 4rem; }
.dash-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.dash-top .wordmark { display: none; }
.dash-title { margin: 0; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--navy); line-height: 1.15; }
.dash-sub { margin: .3rem 0 0; color: var(--muted); }
.dash-top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .6rem; }
.dash-bell { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); color: var(--navy); }
.dash-bell .dash-count { position: absolute; top: -4px; inset-inline-end: -4px; margin: 0; }
.dash-content { display: grid; gap: 1.5rem; max-width: 1180px; }

/* Flash + alerts */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); font-size: .95rem; }
.alert .icon { flex: none; width: 20px; color: var(--gold-deep); }
.alert-success { border-color: rgba(47, 107, 79, .3); background: #f1f7f3; }
.alert-success .icon { color: var(--success); }
.alert-error { border-color: rgba(163, 55, 43, .3); background: #fbf1ef; color: var(--danger); }
.alert-error .icon { color: var(--danger); }
.alert-privacy { background: #f7f1e6; border-color: #eadfca; }
.alert p { margin: 0; }
.alert strong { display: block; color: var(--navy); }

/* Cards and grids */
.dcard { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.1rem, 2.4vw, 1.6rem); }
.dcard-navy { background: var(--navy); border-color: var(--navy); color: var(--cream); position: relative; overflow: hidden; }
.dcard-navy .muted { color: var(--muted-light); }
.dcard-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dcard-head h2, .dcard h2 { margin: 0; font-family: var(--serif); font-size: 1.3rem; color: inherit; }
.dcard-navy h2 { color: var(--cream); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.stat { display: grid; gap: .25rem; }
.stat-value { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--navy); }
.dcard-navy .stat-value { color: var(--cream); font-size: 3.4rem; }
.stat-label { font-size: .85rem; color: var(--muted); }
.hero-stat { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; min-height: 9rem; }
.hero-stat .door-lines { position: absolute; inset-inline-end: -1.5rem; bottom: -2rem; width: 11rem; color: var(--gold); opacity: .35; }
.meter { height: 6px; border-radius: 999px; background: var(--cream); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--cream); color: var(--navy); }
.badge .icon { width: 14px; height: 14px; }
.badge-sent { background: #e7eef8; color: #2b4f80; }
.badge-viewed { background: #eee8f8; color: #5a3f8c; }
.badge-accepted, .badge-verified { background: #e3f1e8; color: #2f6b4f; }
.badge-declined, .badge-rejected { background: #f8e5e2; color: #a3372b; }
.badge-withdrawn, .badge-none { background: #ecebe8; color: #66625b; }
.badge-pending { background: #f7ecd6; color: #8a6d3b; }
.badge-gold { background: var(--gold-soft); color: var(--navy); }
.badge-match { background: #e3f1e8; color: #2f6b4f; }

/* Filter tabs */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.tabs a { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--white); text-decoration: none; font-size: .88rem; }
.tabs a[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }

/* Pitch cards */
.pitch-list { display: grid; gap: 1rem; }
.pcard { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; padding: .8rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s; }
.pcard:hover { border-color: var(--gold); box-shadow: var(--shadow); color: inherit; }
.pcard-photo { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--cream); }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard-body { min-width: 0; display: grid; gap: .2rem; }
.pcard-title { font-family: var(--serif); font-size: 1.2rem; color: var(--navy); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-meta { margin: 0; color: var(--muted); font-size: .88rem; }
.pcard-price { margin: .3rem 0 0; font-size: 1.15rem; font-weight: 600; color: var(--navy); }
.pcard-side { display: grid; justify-items: end; gap: .5rem; padding-inline-end: .5rem; }
.pcard-who { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.star { color: var(--gold); }

/* Avatars */
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--gold); font-family: var(--serif); font-size: 1rem; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: .8rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.avatar-anon { background: var(--cream); color: var(--navy); border: 1px solid var(--line); }
.avatar-anon .icon { width: 55%; height: 55%; }

/* Brief cards (agent discovery) */
.brief-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.brief { display: grid; gap: .9rem; grid-template-rows: auto 1fr auto; }
.brief-head { display: flex; gap: .8rem; align-items: center; }
.brief-head h3 { margin: 0; font-family: var(--serif); font-size: 1.2rem; color: var(--navy); }
.verified-line { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--success); }
.verified-line .icon { width: 16px; height: 16px; }
.brief-facts { display: grid; gap: .45rem; margin: 0; font-size: .92rem; }
.brief-facts li { display: flex; gap: .6rem; align-items: center; }
.brief-facts .icon { width: 18px; height: 18px; color: var(--gold-deep); }

/* Detail pages */
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 1.5rem; align-items: start; }
.gallery { display: grid; gap: .6rem; }
.gallery-main { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--navy); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.gallery-thumbs a { aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid transparent; }
.gallery-thumbs a:hover, .gallery-thumbs a[aria-current] { border-color: var(--gold); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.price-big { font-family: var(--serif); font-size: 2.1rem; color: var(--navy); margin: .3rem 0 0; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.kv div { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.kv div:nth-child(odd) { padding-inline-end: 1rem; }
.kv dt { font-size: .78rem; color: var(--muted); }
.kv dd { margin: .2rem 0 0; font-weight: 600; color: var(--navy); }
.stack { display: grid; gap: .75rem; }
.btn-row-tight { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-row-tight .btn { flex: 1 1 auto; }
.btn-danger { background: transparent; border-color: rgba(163, 55, 43, .45); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.inline-form { display: inline; margin: 0; }

/* Forms in the dashboard */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; padding: 0; margin: 0; }
.chips legend { width: 100%; font-size: .9rem; font-weight: 500; margin-bottom: .5rem; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; }
.chips span { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: .9rem; transition: all .15s; }
.chips input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: flex-end; }
.progress-note { font-size: .85rem; color: var(--muted); }
.upload { display: grid; place-items: center; gap: .4rem; padding: 1.6rem; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--paper); text-align: center; cursor: pointer; }
.upload:hover { border-color: var(--gold); }
.upload .icon { width: 30px; height: 30px; color: var(--gold-deep); }
.upload input { max-width: 100%; }
.thumbs-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.thumbs-preview img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.switch { display: flex; align-items: center; gap: .7rem; font-size: .95rem; cursor: pointer; }
.switch input { width: 42px; height: 24px; appearance: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.switch input:checked { background: var(--success); }
.switch input:checked::after { inset-inline-start: 21px; }

/* Steps (verification) */
.steps-line { display: flex; justify-content: space-between; position: relative; margin: 1.5rem 0; }
.steps-line::before { content: ""; position: absolute; top: 11px; inset-inline: 10%; height: 2px; background: var(--line); }
.steps-line li { position: relative; display: grid; justify-items: center; gap: .4rem; flex: 1; font-size: .82rem; color: var(--muted); }
.steps-line li span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); }
.steps-line li.done span { background: var(--gold); border-color: var(--gold); }
.steps-line li.now span { border-color: var(--gold); box-shadow: inset 0 0 0 4px var(--white); background: var(--gold); }
.steps-line li.now { color: var(--navy); font-weight: 600; }
.big-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep); }
.big-icon .icon { width: 40px; height: 40px; }
.center-card { max-width: 34rem; margin-inline: auto; text-align: center; }
.center-card .form { text-align: start; }

/* Messages */
.chat-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.conv-list-wrap { min-width: 0; }
.conv-list { display: grid; gap: .25rem; }
.conv { display: flex; gap: .8rem; align-items: center; padding: .8rem; border-radius: 12px; text-decoration: none; color: inherit; min-width: 0; overflow: hidden; }
.conv:hover { background: var(--white); color: inherit; }
.conv[aria-current] { background: var(--white); box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] .conv[aria-current] { box-shadow: inset -3px 0 0 var(--gold); }
.conv-body { min-width: 0; flex: 1; }
.conv-name { display: flex; margin: 0; font-weight: 600; color: var(--navy); display: flex; justify-content: space-between; gap: .5rem; }
.conv-name time { font-weight: 400; font-size: .75rem; color: var(--muted); }
.conv-preview { display: block; margin: 0; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.is-unread .conv-preview { color: var(--navy); font-weight: 600; }
.thread { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; min-height: 70vh; }
.thread-head { display: flex; gap: .8rem; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.thread-head h2 { margin: 0; font-size: 1.1rem; font-family: var(--sans); font-weight: 600; color: var(--navy); }
.thread-pitch { display: flex; gap: .8rem; align-items: center; margin: .9rem 1.2rem 0; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.thread-pitch img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.thread-body { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; overflow-y: auto; max-height: 60vh; }
.bubble { max-width: min(78%, 34rem); padding: .7rem .95rem; border-radius: 16px; background: var(--cream); color: var(--navy); align-self: flex-start; overflow-wrap: anywhere; }
.bubble-text { white-space: pre-wrap; }
.bubble.mine { align-self: flex-end; background: var(--navy); color: var(--cream); border-end-end-radius: 4px; }
.bubble:not(.mine) { border-end-start-radius: 4px; }
.bubble time { display: block; margin-top: .3rem; font-size: .7rem; opacity: .7; }
.bubble .file { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; margin-top: .3rem; border-radius: 10px; background: rgba(255, 255, 255, .6); color: var(--navy); text-decoration: none; font-size: .88rem; }
.bubble.mine .file { background: rgba(255, 255, 255, .12); color: var(--cream); }
.day-sep { align-self: center; font-size: .75rem; color: var(--muted); padding: .2rem .8rem; }
.composer { display: flex; gap: .6rem; align-items: flex-end; padding: .8rem 1rem; border-top: 1px solid var(--line); background: var(--paper); }
.composer textarea { flex: 1; min-height: 46px; max-height: 10rem; resize: vertical; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 22px; background: var(--white); }
.composer .attach { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.composer .attach input { display: none; }
.composer .send { width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; }
.composer .file-name { font-size: .75rem; color: var(--muted); }
.side-panels { display: grid; gap: 1rem; }
.stars-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .2rem; border: 0; padding: 0; margin: 0; }
.stars-input input { position: absolute; opacity: 0; }
.stars-input label { font-size: 1.8rem; color: var(--line); cursor: pointer; line-height: 1; }
.stars-input input:checked ~ label, .stars-input label:hover, .stars-input label:hover ~ label { color: var(--gold); }
.stars-input input:focus-visible + label { outline: 2px solid var(--navy); border-radius: 4px; }

/* Notifications */
.notif-list { display: grid; }
.notif { display: flex; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.notif:hover { color: inherit; }
.notif.is-unread .notif-title::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: .5rem; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.notif-title { margin: 0; font-weight: 600; color: var(--navy); }
.notif-text { margin: .15rem 0 0; color: var(--muted); font-size: .92rem; }
.notif time { margin-inline-start: auto; font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* Empty states + pagination */
.empty { text-align: center; padding: 3rem 1rem; }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 1rem; color: var(--gold-deep); }
.empty h2 { font-family: var(--serif); font-size: 1.4rem; color: var(--navy); }
.empty p { color: var(--muted); max-width: 28rem; margin-inline: auto; }
.pager { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.pager a, .pager span { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); text-decoration: none; font-size: .9rem; }
.pager span { opacity: .5; }

/* Plans */
.plan-card { display: grid; gap: 1rem; }
.plan-price { font-family: var(--serif); font-size: 2.4rem; color: inherit; margin: 0; }

/* Auth pages */
.auth { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: clamp(2rem, 6vw, 4rem) var(--gutter); }
.auth-card { width: min(100%, 30rem); }
.auth-card.wide { width: min(100%, 36rem); }
.auth-card .dcard { padding: clamp(1.4rem, 4vw, 2.2rem); }
.auth-card h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--navy); margin-bottom: .4rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: .95rem; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; border: 0; padding: 0; margin: 0; }
.role-pick label { position: relative; cursor: pointer; }
.role-pick input { position: absolute; opacity: 0; }
.role-pick .role-box { display: grid; gap: .3rem; padding: 1rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); height: 100%; }
.role-pick .role-box strong { color: var(--navy); }
.role-pick .role-box small { color: var(--muted); }
.role-pick .icon { width: 26px; height: 26px; color: var(--gold-deep); }
.role-pick input:checked + .role-box { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.role-pick input:focus-visible + .role-box { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Mobile bottom tabs */
.dash-tabs { display: none; }

@media (max-width: 1024px) {
    .dash-shell { grid-template-columns: 1fr; }
    .dash-side { display: none; }
    .dash-top .wordmark { display: inline-flex; }
    .dash-top .wordmark-text { display: none; }
    .dash-main { padding-bottom: 6.5rem; }
    .dash-tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: .4rem .4rem calc(.4rem + env(safe-area-inset-bottom)); background: rgba(250, 242, 230, .97); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
    .dash-tabs a { position: relative; display: grid; justify-items: center; gap: .15rem; padding: .35rem 0; text-decoration: none; font-size: .7rem; color: var(--muted); }
    .dash-tabs a[aria-current="page"] { color: var(--gold-deep); font-weight: 600; }
    .dash-tabs .icon { width: 22px; height: 22px; }
    .dash-tabs .dash-count { position: absolute; top: 0; inset-inline-start: 55%; margin: 0; font-size: .62rem; min-width: 1.1rem; line-height: 1.1rem; }
    .detail, .chat-layout { grid-template-columns: 1fr; }
    .chat-layout.has-thread .conv-list-wrap { display: none; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .pcard { grid-template-columns: 110px minmax(0, 1fr); }
    .pcard-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; padding: 0 .3rem; }
    .kv { grid-template-columns: 1fr 1fr; }
    .role-pick { grid-template-columns: 1fr; }
    .thread { min-height: 0; }
    .thread-body { max-height: 55vh; }
}

/* Inline icons inside running text */
.dash p > .icon, .dash .small > .icon, .dash .badge > .icon, .dash .link-button > .icon { display: inline-block; vertical-align: -.2em; width: 1.1em; height: 1.1em; }
.input-affix .affix { white-space: nowrap; }

@media (max-width: 1024px) {
    .dash-top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .9rem 1rem; }
    .dash-top > .wordmark { grid-column: 1; grid-row: 1; }
    .dash-top > .wordmark .wordmark-text { display: grid; }
    .dash-top > .wordmark .wordmark-latin { font-size: 1.05rem; }
    .dash-top > .wordmark .wordmark-arabic { font-size: .85rem; }
    .dash-top > .wordmark .logo-mark { width: 26px; height: 33px; }
    .dash-top-actions { grid-column: 2; grid-row: 1; }
    .dash-top > div:not(.dash-top-actions) { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) {
    .pcard-side { display: flex; flex-wrap: wrap; gap: .4rem .6rem; justify-content: flex-start; padding: 0 .3rem .2rem; }
    .pcard-side > .small.muted:last-child { display: none; }
    .dash-title { font-size: 1.7rem; }
}

/* Match reasons, report & block */
.match-reasons { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .6rem .9rem; border-radius: 10px; background: #eef6f1; color: #2f6b4f; font-size: .9rem; font-weight: 500; }
.report-box summary { list-style: none; cursor: pointer; color: var(--muted); }
.report-box summary::-webkit-details-marker { display: none; }
.report-box[open] summary { margin-bottom: .75rem; }
.report-box .form { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.danger-link { color: var(--danger) !important; }
.flag-note { display: flex; align-items: center; gap: .35rem; font-size: .78rem; opacity: .85; margin-top: .35rem; }
.flag-note .icon { width: 14px; height: 14px; }
.badge-expired { background: #ecebe8; color: #66625b; }

/* Sidebar column background spans the full page height (long pages, prints, screenshots). */
@media (min-width: 1025px) {
    .dash-shell { background: linear-gradient(to right, var(--paper) 259px, var(--line) 259px, var(--line) 260px, transparent 260px); }
    [dir="rtl"] .dash-shell { background: linear-gradient(to left, var(--paper) 259px, var(--line) 259px, var(--line) 260px, transparent 260px); }
}

/* Own file picker (native button text follows the browser language, not the site) */
.upload input[type="file"], .file-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload { position: relative; }
.file-pick { position: relative; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; cursor: pointer; }
.file-btn { display: inline-flex; align-items: center; min-height: 40px; padding: .45rem 1rem; border: 1px solid var(--navy); border-radius: 6px; background: var(--white); color: var(--navy); font-size: .9rem; font-weight: 500; }
.upload:hover .file-btn, .file-pick:hover .file-btn { background: var(--navy); color: var(--cream); }
.file-names { font-size: .85rem; color: var(--muted); }
.upload:focus-within, .file-pick:focus-within .file-btn { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Fields keep label + input at the top, also next to a field with a hint */
.form-grid .field, .form .field { align-content: start; }
@media (max-width: 720px) {
    .price-big { font-size: 1.7rem; white-space: nowrap; }
    .thread-body { border-top: 1px solid var(--line); margin-top: .9rem; }
}

/* Checklists (plan cards, shared details) */
.checklist { display: grid; gap: .6rem; margin: .5rem 0; }
.checklist li { display: flex; gap: .6rem; align-items: center; }
.checklist .icon { width: 18px; height: 18px; flex: none; color: var(--gold-deep); }
.dcard-navy .checklist .icon { color: var(--gold); }

/* Chat opening lines */
.openers { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .9rem 1.1rem 0; }
.openers[hidden] { display: none; }
.opener { font: inherit; font-size: .88rem; line-height: 1.4; text-align: start; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: .5rem .85rem; cursor: pointer; max-width: 100%; }
.opener:hover, .opener:focus-visible { border-color: var(--gold); background: var(--paper); }

/* Brief: lifestyle questions and area guide */
.lifestyle { padding: 1.25rem; border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); }
.lifestyle h2 { margin: 0; font-size: 1.25rem; }
.chips label.is-suggested span { border-style: dashed; border-color: var(--gold); }
.chips label.is-suggested span::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-start: .45rem; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.chips input:disabled + span { opacity: .45; cursor: not-allowed; }
.area-guide { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: .9rem 1.1rem; }
.area-guide summary { cursor: pointer; font-weight: 600; }
.area-guide dl { display: grid; gap: .9rem; margin: 1rem 0 .2rem; }
.area-guide dt { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.area-guide dd { margin: .2rem 0 0; font-size: .92rem; line-height: 1.55; }
.area-guide .guide-fit { display: none; font-size: .78rem; font-weight: 500; color: var(--gold-deep); }
.area-guide .is-fit .guide-fit { display: inline; }

.chips legend span { display: inline; padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; }
.chips .suggest-note { flex-basis: 100%; margin: 0 0 .3rem; display: flex; align-items: center; gap: .45rem; }
.chips .suggest-note[hidden] { display: none; }
.chips .suggest-note .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); padding: 0; border: 0; }
.chips .chips-hint { flex-basis: 100%; margin: -.2rem 0 .4rem; }
.chips .no-pref span { border-style: dashed; }
.chips .no-pref input:checked + span { border-style: solid; background: var(--navy); border-color: var(--navy); color: var(--cream); }


/* Maps (Leaflet) */
.map-search { display: flex; gap: .5rem; }
.map-search input { flex: 1; }
.map-results { list-style: none; margin: .4rem 0 0; padding: .3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); display: grid; gap: .1rem; }
.map-results[hidden] { display: none; }
.map-results button { width: 100%; text-align: start; font: inherit; font-size: .9rem; padding: .5rem .6rem; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.map-results button:hover, .map-results button:focus-visible { background: var(--paper); }
.map-results li.muted { padding: .5rem .6rem; font-size: .9rem; }
.map-canvas { height: 320px; margin-top: .6rem; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map-pin span { display: block; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; background: var(--navy); border: 3px solid var(--gold); transform: rotate(-45deg); box-shadow: 0 4px 10px rgba(16, 35, 58, .35); }
.map-area-note { margin: .2rem 0 0; }
.map-area-note.is-warning { color: var(--danger); font-weight: 500; }
.nearby { margin-top: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.nearby h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.nearby-list, .nearby-schools { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .93rem; }
.nearby-list li { display: flex; gap: .5rem; align-items: flex-start; }
.nearby-list .icon { width: 16px; height: 16px; margin-top: .2rem; color: var(--gold-deep); flex: none; }
.nearby-schools { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.nearby-schools .badge { margin-inline-start: .3rem; }
.nearby > .small { margin: .7rem 0 0; }
.pitch-map .map-canvas { height: 260px; margin-top: 0; }
.quick-replies { padding: .7rem 1.1rem 0; }
.quick-replies summary { cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--gold-deep); }
.quick-replies .openers { padding: .6rem 0 0; }
.first-message { margin-bottom: .2rem; }
.first-message label span { font-size: .85rem; text-align: start; border-radius: 14px; }
.chips .area-filter { flex-basis: 100%; margin-bottom: .3rem; }
.chips label[hidden] { display: none; }
.chips .chips-sub { flex-basis: 100%; margin: .2rem 0 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.chips .more-areas { flex-basis: 100%; margin-top: .4rem; }
.chips .more-areas summary { cursor: pointer; font-size: .9rem; font-weight: 500; color: var(--gold-deep); margin-bottom: .5rem; }
.chips .more-areas > .chips { margin-top: .3rem; }

/* Investor: areas on a map */
.area-picker { border: 0; padding: 0; margin: 0; display: grid; gap: .7rem; }
.area-picker legend { font-size: .9rem; font-weight: 500; margin-bottom: .5rem; }
.area-map-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.area-map-filters button { font: inherit; font-size: .85rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.area-map-filters button.is-active { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.area-map-filters .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; }
.dot-apartment { background: #2f5d8c; } .dot-villa { background: #2f6b4f; } .dot-mixed { background: #c77c2e; }
.area-map-canvas { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.area-map .leaflet-popup-content { margin: .8rem .9rem; font-family: var(--sans); }
.area-map .leaflet-popup-content p { margin: .35rem 0 .6rem; font-size: .85rem; line-height: 1.45; }
.area-selected { align-items: center; }
.area-chosen { display: contents; }
.area-chip-on { font: inherit; font-size: .9rem; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--gold); background: var(--gold); color: var(--navy); font-weight: 600; cursor: pointer; }

/* Area list under the map: also the way to pick areas when the map cannot load. */
.area-list { margin-top: .75rem; }
.area-list > summary { cursor: pointer; font-size: .9rem; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; margin-bottom: .6rem; }
.area-list .chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Emirate heading inside an area chip list. */
.chips-head { flex-basis: 100%; margin: .6rem 0 .1rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #6b7280); }
.chips-head:first-of-type { margin-top: 0; }
[dir="rtl"] .chips-head { letter-spacing: 0; }
