/* ═══════ THE PROPERTY DASHBOARD FOR AN AGENT (dashboard-assets/agent-mode.js) ═══════
   1. What is the office's is not offered: hidden from the first paint (html.as-agent, from the
      device's last answer in access.js) and once the sign-in confirms it (body.agent-mode). The
      server and firestore.rules refuse these anyway; this only keeps the screen honest.
   2. The agent's own pieces: the access line on a property, the lock on a card, Mine / Shared / All.
   3. The request sheets (shared-assets/agent-client.js openSheet), styled here — scoped to .sheet
      and .scrim, so nothing of the agent pages' stylesheet touches the dashboard's own look. */

/* 1 ── The office's tools */
html.as-agent body:not(.agent-can-add) .addp-btn, html.as-agent body:not(.agent-can-add) .mobile-fab,
body.agent-mode:not(.agent-can-add) .addp-btn, body.agent-mode:not(.agent-can-add) .mobile-fab,
body.agent-mode [data-act="pin"], #dp.ag-locked #dpMapRow,
html.as-agent #dp .dp-hact[onclick^="openEditModal"], html.as-agent #dp .dp-hact.danger, html.as-agent #dpSoldOut,
body.agent-mode #dp .dp-hact[onclick^="openEditModal"], body.agent-mode #dp .dp-hact.danger, body.agent-mode #dpSoldOut,
body.agent-mode .note-delete, body.agent-mode .int-act, body.agent-mode .int-add,
body.agent-mode #dpMarketing, body.agent-mode .interest-sec,
body.agent-mode #mapPinBar, body.agent-mode .dup-note,
body.agent-mode #msToolbar .ms-btn[onclick^="exportSelected"],
body.agent-mode .conn-mapedit, body.agent-mode .export-btn[onclick^="exportProperty"],
#dp.ag-locked .needs-full, #dp.ag-locked .res-chips, #dp.ag-locked .export-btn:not([onclick^="sharePropertyLink"]) { display: none !important; }
body.agent-mode.agent-can-export #msToolbar .ms-btn[onclick^="exportSelected"] { display: inline-flex !important; }
@media (max-width: 899px) {
  body.has-tabbar #msToolbar { bottom: calc(62px + env(safe-area-inset-bottom)); }
  body.agent-mode #main { padding-bottom: 96px; }   /* the last card clears the floating + */
}
/* Thumbs: 40px targets on touch screens (the property's buttons, a buyer's buttons, Compare). */
@media (pointer: coarse) { #dp .dp-hact, .pm-btn, .card-cmp { min-height: 40px; } }

/* 2 ── The agent's own pieces */
.badge.ag-lock { background: light-dark(#F1EFEC, #2A2724); color: light-dark(#57534E, #CFC8C0); }
.badge.ag-asked { background: light-dark(#FFF7E0, rgba(255,190,40,.16)); color: light-dark(#8A5A00, #FFD27A); }
.badge.ag-shared { background: light-dark(#E8F1FF, rgba(80,140,255,.16)); color: light-dark(#1D4ED8, #9DBBFF); }
.badge.ag-mine { background: light-dark(#E7F6EC, rgba(40,200,110,.14)); color: light-dark(#166534, #7EE2A8); }
.card.ag-locked .card-name { color: var(--ink2); }
.card-cta .cta-btn.cta-ask { background: var(--brand-soft, #FFF1DF); color: var(--brand-ink, #8A4B00); }

.ag-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border); }
.ag-seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 650; color: var(--ink3); cursor: pointer; min-height: 34px; white-space: nowrap; }
.ag-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.ag-seg .n { font-weight: 600; color: var(--ink3); margin-left: 4px; }
@media (pointer: coarse) { .ag-seg button { min-height: 40px; } }

.ag-panel { margin: 0 28px 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
.ag-panel.locked { background: light-dark(#FAF8F5, #1F1D1A); }
.ag-panel.granted { background: light-dark(#F3F7FF, rgba(80,140,255,.08)); border-color: light-dark(#C9DBFF, rgba(80,140,255,.3)); }
.ag-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink2); }
.ag-line i { color: var(--ink3); margin-top: 3px; }
.ag-refused { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; background: light-dark(#FFF7E0, rgba(255,190,40,.12)); color: light-dark(#6B4600, #FFD27A); }
.ag-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.ag-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border2); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
.ag-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ag-btn.danger { color: light-dark(#B42318, #FF9C9C); }
.ag-btn:disabled { opacity: .55; cursor: default; }
.ag-tag { display: inline-block; font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--bg2); color: var(--ink2); }
.ag-tag.wait { background: light-dark(#FFF7E0, rgba(255,190,40,.14)); color: light-dark(#8A5A00, #FFD27A); }
.ag-tag.red { background: light-dark(#FDECEC, rgba(255,80,80,.14)); color: light-dark(#B42318, #FF9C9C); }
.ag-avail { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--ink2); }
.ag-avail select { min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border2); background: var(--card); color: var(--ink); font: inherit; }
.dp-agent .ag-name { font-weight: 650; font-size: 14px; }
.ag-jump { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid light-dark(#C9DBFF, rgba(80,140,255,.3));
  background: light-dark(#F3F7FF, rgba(80,140,255,.08)); color: light-dark(#1D3E8A, #BFD3FF); font: inherit; font-size: 13.5px; font-weight: 650; text-align: left; cursor: pointer; min-height: 44px; }
.ag-matches { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ag-matches-h { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); display: flex; gap: 8px; align-items: center; }
.ag-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12px; display: inline-grid; place-items: center; letter-spacing: 0; }
.ag-note { color: var(--ink3); font-size: 13px; margin: 6px 0 10px; }
.ag-match { padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin: 8px 0; background: var(--card); }
.ag-match p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink2); }
.ag-match .ag-ai { color: var(--ink3); }
@media (max-width: 899px) { .ag-panel { margin: 0 14px 4px; } }

/* 3 ── The request sheets */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 590; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 591; background: var(--card); color: var(--ink); font-family: var(--sans);
  border-radius: 16px 16px 0 0; padding: 14px 16px 0; max-height: 90vh; overflow: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.2); font-size: 15px; line-height: 1.45; }
@media (min-width: 640px) { .sheet { left: 50%; right: auto; width: 540px; translate: -50% 0; bottom: 24px; border-radius: 16px; max-height: calc(100vh - 48px); } }
.sheet *, .sheet *::before, .sheet *::after { box-sizing: border-box; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.sheet .sub { color: var(--ink3); font-size: 13.5px; margin: 0 0 12px; overflow-wrap: anywhere; }
.sheet .note { color: var(--ink3); font-size: 13.5px; margin: 8px 0 0; }
.sheet .err { color: light-dark(#B42318, #FF9C9C); font-size: 13.5px; min-height: 18px; margin: 8px 0 0; }
.sheet .two { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 480px) { .sheet .two { grid-template-columns: 1fr 1fr; } }
.sheet .field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.sheet .field label { font-size: 13px; color: var(--ink2); font-weight: 600; }
.sheet select, .sheet input[type="text"], .sheet input[type="tel"], .sheet input[type="datetime-local"] { min-height: 44px; padding: 0 12px; border: 1px solid var(--border2); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; font: inherit; }
.sheet textarea { min-height: 88px; padding: 10px 12px; border: 1px solid var(--border2); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; font: inherit; resize: vertical; }
.sheet .bar { display: flex; gap: 10px; margin: 14px -16px 0; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--border); }
.sheet .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border2); background: var(--card); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.sheet .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sheet .btn.block { flex: 1; }
.sheet .btn:disabled { opacity: .55; cursor: default; }

.gmeta-r:empty { display: none; }
