/* R-ONE Market — personal realtor page (/m/agent/:slug). Built on the shared
 * --m-* tokens and .m-sheet components; the realtor can only pick an accent
 * from the CRM branding presets (--agent-accent), never their own CSS. */

/* Та сама фірмова панорама, що й у презентації об'єкта. Вона живе окремим
 * нерухомим шаром, тому не змінює розмітку профілю та не заважає клікам. */
.m-agent-cityscape {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.m-agent-cityscape::before,
.m-agent-cityscape::after { content: ''; position: absolute; inset: 0; }
.m-agent-cityscape::before {
  background: url('/assets/rone-presentation-city-dark.jpg') center 84px / 100% auto no-repeat fixed;
  opacity: .76;
}
.m-agent-cityscape::after {
  background:
    linear-gradient(90deg, rgba(4, 10, 24, .7) 0%, rgba(7, 18, 42, .32) 50%, rgba(4, 10, 24, .68) 100%),
    linear-gradient(180deg, rgba(4, 10, 24, .08) 0%, rgba(4, 10, 24, .2) 52%, rgba(4, 10, 24, .7) 100%);
}
html[data-theme="light"] .m-agent-cityscape::before {
  background-image: url('/assets/rone-presentation-city-light.jpg');
  opacity: .82;
}
html[data-theme="light"] .m-agent-cityscape::after {
  background:
    linear-gradient(90deg, rgba(247, 251, 255, .64) 0%, rgba(244, 249, 255, .22) 50%, rgba(239, 247, 255, .6) 100%),
    linear-gradient(180deg, rgba(247, 251, 255, .04) 0%, rgba(239, 246, 253, .16) 52%, rgba(232, 241, 250, .7) 100%);
}
.m-agent-body > .m-agent,
.m-agent-body > .m-footer { position: relative; z-index: 1; }
.m-agent-body > .m-crm-ribbon { position: relative; z-index: 21; }

.m-agent { --agent-accent: var(--m-accent); padding-top: 22px; padding-bottom: 72px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.m-agent-hero {
  margin-bottom: 32px; border-radius: 24px; background: color-mix(in srgb, var(--m-surface) 94%, transparent);
  box-shadow: 0 28px 70px -48px color-mix(in srgb, var(--agent-accent) 58%, transparent);
}
.m-agent-banner {
  position: relative; isolation: isolate; min-height: 360px; overflow: hidden; border-radius: 24px 24px 0 0;
  background: #063f94; color: #fff;
}
.m-agent-cover {
  position: absolute; z-index: -2; inset: 0; overflow: hidden;
  background:
    radial-gradient(70% 140% at 20% 45%, color-mix(in srgb, var(--agent-accent) 72%, transparent), transparent 68%),
    radial-gradient(55% 120% at 92% 12%, rgba(34, 211, 238, .48), transparent 68%),
    linear-gradient(128deg, #072b68 0%, #0756b8 52%, #071d4b 100%);
}
.m-agent-cover::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 20, 54, .28), rgba(3, 31, 83, .08) 52%, rgba(3, 21, 56, .24)),
    linear-gradient(180deg, rgba(3, 20, 54, .04), rgba(3, 20, 54, .48));
}
.m-agent-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.m-agent-card { min-width: 0; }
.m-agent-details {
  padding: 0 34px 28px; border: 1px solid var(--m-border); border-top: 0; border-radius: 0 0 24px 24px;
  background: color-mix(in srgb, var(--m-surface) 96%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.m-agent-profile-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; }
.m-agent-identity { display: flex; align-items: flex-end; gap: 24px; min-width: 0; }
.m-agent-avatar {
  position: relative; z-index: 3; flex: 0 0 168px; width: 168px; height: 168px; margin-top: -78px; border-radius: 50%; object-fit: cover;
  border: 6px solid color-mix(in srgb, var(--m-surface) 96%, #071a35); background: var(--m-surface);
  box-shadow: 0 20px 46px -18px rgba(0, 8, 32, .88), 0 0 0 2px color-mix(in srgb, var(--agent-accent) 70%, #72e6ff), 0 0 28px -5px color-mix(in srgb, var(--agent-accent) 70%, transparent);
}
.m-agent-avatar--initials {
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--agent-accent), #0e2038);
}
.m-agent-titles { min-width: 0; padding: 20px 0 10px; }
.m-agent-trust {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; margin: 0 0 10px; padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--agent-accent) 34%, transparent); border-radius: 999px;
  color: color-mix(in srgb, var(--agent-accent) 56%, var(--m-text)); background: color-mix(in srgb, var(--agent-accent) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--agent-accent) 4%, transparent), 0 0 18px -10px color-mix(in srgb, var(--agent-accent) 72%, transparent);
  font-size: .7rem; font-weight: 800; letter-spacing: .09em; line-height: 1; text-transform: uppercase;
}
.m-agent-trust-dot { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--agent-accent) 72%, #66edff); box-shadow: 0 0 10px color-mix(in srgb, var(--agent-accent) 76%, #52e5ff); }
.m-agent-titles h1 { margin: 0; color: var(--m-text); font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.02; letter-spacing: -.035em; overflow-wrap: anywhere; }
.m-agent-org { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 11px 0 0; color: var(--m-muted); font-weight: 600; }
.m-agent-org img { width: 20px; height: 20px; border-radius: 5px; object-fit: contain; background: #fff; }
.m-agent-affiliation { margin: 5px 0 0; color: var(--m-muted); font-size: .84rem; font-weight: 600; letter-spacing: .01em; }
.m-agent-profile-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 24px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--m-border); }
.m-agent-about { min-width: 0; }
.m-agent-bio { margin: 0; max-width: 720px; color: var(--m-text); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.m-agent-chips { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.m-agent-chips li {
  display: inline-flex; align-items: center; height: auto; min-height: 0; margin: 0; line-height: 1.2;
  padding: 7px 12px; border-radius: 999px; font-size: .84rem; font-weight: 750;
  background: color-mix(in srgb, var(--agent-accent) 10%, transparent); color: var(--m-text);
  border: 1px solid color-mix(in srgb, var(--agent-accent) 28%, transparent); box-shadow: 0 0 16px -12px color-mix(in srgb, var(--agent-accent) 80%, transparent);
}
.m-agent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding-bottom: 12px; }
.m-agent-actions .m-sheet-primary {
  background: linear-gradient(135deg, color-mix(in srgb, var(--agent-accent) 78%, #22d3ee), color-mix(in srgb, var(--agent-accent) 58%, #5b8cff)); color: #fff;
  box-shadow: 0 12px 28px -16px color-mix(in srgb, var(--agent-accent) 88%, transparent), 0 0 18px -10px color-mix(in srgb, var(--agent-accent) 88%, transparent);
}
.m-agent-actions .m-sheet-secondary { border-color: color-mix(in srgb, var(--agent-accent) 26%, var(--m-border)); background: color-mix(in srgb, var(--m-surface) 90%, transparent); }
.m-agent-actions .m-sheet-secondary:hover { border-color: color-mix(in srgb, var(--agent-accent) 64%, transparent); box-shadow: 0 0 20px -12px color-mix(in srgb, var(--agent-accent) 82%, transparent); }
.m-agent-share-status { font-size: .86rem; font-weight: 700; color: #16a34a; }

.m-agent-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.m-agent-side:only-child { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-agent-trust-card, .m-agent-stats, .m-agent-contacts {
  margin: 0; padding: 16px; border-radius: 16px; color: var(--m-text);
  border: 1px solid color-mix(in srgb, var(--agent-accent) 32%, var(--m-border));
  background: color-mix(in srgb, var(--m-surface) 88%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--agent-accent) 4%, transparent), 0 0 24px -16px color-mix(in srgb, var(--agent-accent) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.m-agent-trust-card { display: grid; gap: 14px; }
.m-agent-trust-head { display: flex; align-items: center; gap: 11px; }
.m-agent-trust-head > div { display: grid; gap: 2px; }
.m-agent-trust-head span:not(.m-agent-trust-shield) { color: var(--m-muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.m-agent-trust-head h2 { margin: 0; font-size: 1rem; }
.m-agent-trust-shield {
  display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px;
  color: #fff; font-weight: 900; background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 10px 24px -14px rgba(22, 163, 74, .9);
}
.m-agent-trust-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.m-agent-trust-list li { display: flex; align-items: flex-start; gap: 8px; color: var(--m-text); font-size: .86rem; line-height: 1.35; }
.m-agent-trust-list li > span { flex: 0 0 18px; color: #16a34a; font-weight: 900; text-align: center; }
.m-agent-trust-list strong { font-weight: 700; }
.m-agent-trust-note { margin: 0; padding-top: 11px; border-top: 1px solid var(--m-border); color: var(--m-muted); font-size: .72rem; line-height: 1.45; }
.m-agent-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px 16px; }
.m-agent-stats div { display: grid; gap: 2px; }
.m-agent-stats dt { font-size: .78rem; color: var(--m-muted); font-weight: 600; }
.m-agent-stats dd { margin: 0; font-size: 1.4rem; font-weight: 800; }
.m-agent-contacts { list-style: none; display: grid; gap: 10px; }
.m-agent-contacts li { display: grid; gap: 1px; }
.m-agent-contacts span { font-size: .78rem; color: var(--m-muted); font-weight: 600; }
.m-agent-contacts a { color: var(--m-text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; min-height: 28px; display: inline-flex; align-items: center; }
.m-agent-contacts a:hover { color: var(--agent-accent); }

.m-agent-listings-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.m-agent-listings-head h2 { margin: 0; font-size: 1.35rem; }
.m-agent-count { color: var(--m-muted); font-weight: 600; font-size: .9rem; }
.m-agent-search { display: flex; gap: 8px; margin-bottom: 12px; }
.m-agent-search input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--m-border); background: var(--m-surface); color: var(--m-text);
}
.m-agent-search input:focus { outline: 0; border-color: var(--agent-accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .22); }
.m-agent-filter-open { display: none; }

/* Desktop: the filter dialog is shown inline as a filter bar (it is the same
   form); on phones it is a bottom sheet opened by «Фільтри». */
@media (min-width: 768px) {
  .m-agent-filters:not([open]) { display: block; position: static; width: auto; max-width: none; margin: 0 0 18px; }
  .m-agent-filters:not([open]) .m-sheet-card { border-radius: 16px; box-shadow: none; }
  .m-agent-filters:not([open]) .m-sheet-head, .m-agent-filters:not([open]) .m-sheet-handle { display: none; }
  .m-agent-filters:not([open]) .m-agent-filter-grid {
    display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(130px, 1fr)) minmax(200px, 1.2fr); gap: 12px; align-items: end; padding: 14px 16px 0;
  }
  .m-agent-filters:not([open]) .m-sheet-field { margin-bottom: 14px; }
  .m-agent-filters:not([open]) .m-sheet-actions { border-top: 0; padding-top: 0; }
}
.m-agent-deal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m-agent-price > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.m-agent-grid { margin-top: 4px; }
.m-agent-pages { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.m-agent-pages a {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 12px;
  border: 1px solid var(--m-border); color: var(--m-text); text-decoration: none; font-weight: 700;
}
.m-agent-pages a[aria-current="page"] { border-color: var(--agent-accent); color: var(--agent-accent); }
.m-agent-empty {
  display: grid; justify-items: center; gap: 12px; padding: 40px 20px; text-align: center;
  border: 1px dashed var(--m-border); border-radius: 18px; background: var(--m-surface);
}
.m-agent-empty h3 { margin: 0; font-size: 1.1rem; }
.m-agent-mobile-bar { display: none; }

@media (max-width: 900px) {
  .m-agent-profile-head { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .m-agent-actions { justify-content: flex-start; padding: 0 0 18px 192px; }
  .m-agent-profile-body { grid-template-columns: minmax(0, 1fr); }
  .m-agent-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .m-agent-cityscape::before {
    background-attachment: scroll;
    background-position: 50% top;
    background-size: auto 520px;
  }
  .m-agent { padding-top: 0; padding-bottom: 110px; }
  .m-agent-hero { margin: 0 -16px 26px; }
  .m-agent-banner { min-height: 0; aspect-ratio: 16 / 9; border-radius: 0; }
  .m-agent-details { padding: 0 16px 22px; border-left: 0; border-right: 0; border-radius: 0; }
  .m-agent-profile-head { grid-template-columns: minmax(0, 1fr); }
  .m-agent-identity { align-items: flex-end; gap: 14px; }
  .m-agent-avatar { flex-basis: 104px; width: 104px; height: 104px; margin-top: -48px; border-width: 4px; }
  .m-agent-avatar--initials { font-size: 1.6rem; }
  .m-agent-titles { padding: 12px 0 6px; }
  .m-agent-trust { margin-bottom: 7px; padding: 5px 8px; font-size: .61rem; letter-spacing: .055em; }
  .m-agent-titles h1 { font-size: clamp(1.7rem, 9vw, 2.4rem); }
  .m-agent-org { margin-top: 8px; font-size: .86rem; }
  .m-agent-profile-body { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 20px; padding-top: 20px; }
  .m-agent-side { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .m-agent-side:only-child { grid-template-columns: minmax(0, 1fr); }
  .m-agent-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-agent-contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-agent-actions { justify-content: stretch; padding: 12px 0 0; }
  .m-agent-actions > * { flex: 1 1 auto; }
  .m-agent-actions .m-sheet-primary, .m-agent-actions .m-sheet-secondary { min-height: 44px; padding: 0 14px; font-size: .95rem; }
  .m-agent-filter-open { display: inline-flex; min-height: 48px; padding: 0 14px; }
  .m-agent-search .m-sheet-primary { display: none; }
  .m-agent-mobile-bar {
    position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; display: flex; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--m-border);
    background: color-mix(in srgb, var(--m-bg) 92%, transparent); backdrop-filter: blur(14px);
  }
  .m-agent-mobile-bar > * { flex: 1 1 0; min-height: 48px; }
  .m-agent-body .m-bottom-nav { display: none; }
}

@media (max-width: 430px) {
  .m-agent-identity { align-items: flex-end; }
  .m-agent-avatar { flex-basis: 88px; width: 88px; height: 88px; margin-top: -40px; }
  .m-agent-trust { max-width: 100%; }
  .m-agent-contacts { grid-template-columns: minmax(0, 1fr); }
}

/* Realtor page callouts use the same readable neon language as Market. */
.m-agent-empty,
.m-agent-trust-card,
.m-agent-stats,
.m-agent-contacts {
  border-style: solid;
  border-color: color-mix(in srgb, var(--agent-accent) 42%, var(--m-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--agent-accent) 7%, transparent), 0 18px 42px -30px color-mix(in srgb, var(--agent-accent) 72%, transparent);
}
.m-agent-empty h3 { font-size: 1.2rem; }
.m-agent-empty p,
.m-agent-trust-note { color: color-mix(in srgb, var(--m-muted) 72%, var(--m-text)); font-size: .9rem; line-height: 1.5; }
.m-agent-trust { font-size: .82rem; line-height: 1.25; }
.m-agent-affiliation,
.m-agent-trust-list li { font-size: .95rem; line-height: 1.5; }
.m-agent-trust-head span:not(.m-agent-trust-shield),
.m-agent-stats dt,
.m-agent-contacts span { font-size: .875rem; line-height: 1.4; }
