:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182033;
  background: #f5f7fb;
}

* { box-sizing: border-box; }

body.profile-page {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(155deg, #f8fbff 0%, #f4f1ff 100%);
}

button, input, textarea, select { font: inherit; }

.profile-shell {
  width: min(100% - 2rem, 80rem);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem) 0;
}

.profile-cover,
.profile-skeleton--cover {
  position: relative;
  min-height: clamp(11rem, 30vw, 22rem);
  overflow: hidden;
  border-radius: 1.4rem;
  background: linear-gradient(125deg, #dce9ff, #ddd5f5 60%, #c7e4e8);
  background-position: center;
  background-size: cover;
}

.profile-cover::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(18, 27, 48, 0.22));
  content: "";
  pointer-events: none;
}

.profile-card {
  position: relative;
  width: min(96%, 74rem);
  margin: -3.5rem auto 0;
  padding: clamp(1.1rem, 2vw, 1.75rem);
  border: 1px solid rgba(116, 130, 157, 0.18);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1.25rem 3rem rgba(34, 51, 84, 0.13);
}

.profile-avatar-wrap { min-height: 4rem; }

.profile-avatar-frame {
  position: relative;
  width: clamp(6.5rem, 15vw, 9rem);
  height: clamp(6.5rem, 15vw, 9rem);
  margin-top: clamp(-5.5rem, -9vw, -4rem);
}

.profile-avatar,
.profile-skeleton--avatar {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 0.4rem solid #fff;
  border-radius: 50%;
  background: #dce4f2;
  box-shadow: 0 0.5rem 1.25rem rgba(34, 51, 84, 0.16);
  object-fit: cover;
}

.profile-avatar--fallback {
  color: #334a85;
  background: linear-gradient(145deg, #dce9ff, #ded9f5);
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 750;
}

.profile-image-edit {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  padding: 0.45rem;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  background: rgba(17, 29, 54, 0.78);
  box-shadow: 0 0.25rem 0.7rem rgba(17, 29, 54, 0.28);
  cursor: pointer;
}

.profile-image-edit:hover { background: rgba(17, 29, 54, 0.96); }
.profile-image-edit:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.15rem; }
.profile-image-edit svg { width: 100%; height: 100%; fill: currentColor; }
.profile-image-edit--cover { top: 0.85rem; right: 0.85rem; }
.profile-image-edit--avatar { top: 0.35rem; right: 0.35rem; }

.profile-image-dialog { width: min(100% - 2rem, 28rem); }
.profile-image-dialog form { gap: 0.85rem; }
.profile-image-dialog label { gap: 0.5rem; }
.profile-image-dialog input[type="file"] { padding: 0.65rem; }
.profile-image-preview {
  display: grid;
  min-height: 8rem;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #bec9dc;
  border-radius: 0.8rem;
  background: #f8faff;
}
.profile-image-preview img { display: block; max-width: 100%; max-height: 15rem; object-fit: contain; }
.profile-image-preview--cover { min-height: 7rem; }
.profile-image-preview--cover img { width: 100%; max-height: 10rem; object-fit: cover; }
.profile-image-remove { margin-left: auto; color: #a42d38; }
.profile-image-remove:hover { color: #7f1d1d; background: #fff1f2; }
.profile-dialog-heading button:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.15rem; }
.profile-image-dialog .profile-status { min-height: 1.35rem; margin: 0; }

.profile-cover-actions {
  display: none;
}

.profile-button {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid #cbd4e4;
  border-radius: 0.65rem;
  color: #26334f;
  background: #fff;
  font-weight: 650;
  cursor: pointer;
}

.profile-button:hover { background: #f4f7fd; }
.profile-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.12rem; }
.profile-button:disabled { cursor: wait; opacity: 0.55; }
.profile-button--primary { border-color: #405bd6; color: #fff; background: #405bd6; }
.profile-button--primary:hover { background: #334bc1; }
.profile-button--quiet { border-color: transparent; color: #59647b; background: transparent; }
.profile-button--glass { border-color: rgba(255, 255, 255, 0.55); color: #fff; background: rgba(17, 29, 54, 0.65); backdrop-filter: blur(8px); }
.profile-button--glass:hover { background: rgba(17, 29, 54, 0.8); }

.profile-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin-top: -4rem;
}

.profile-identity {
  min-width: 0;
  padding-left: clamp(7.5rem, 12vw, 9.5rem);
}

.profile-summary {
  width: 100%;
  margin-top: 0.75rem;
  padding-left: clamp(7.5rem, 12vw, 9.5rem);
}

.profile-summary__edit {
  align-self: center;
  margin-top: -0.4rem;
}

.profile-stats,
.profile-trust-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.profile-trust-stats { display: contents; }

.profile-stat {
  display: flex;
  min-width: 0;
  min-height: 3.15rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #e1e7f0;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, #fff, #f7f9fd);
  box-shadow: 0 0.35rem 1rem rgba(34, 51, 84, 0.06);
}

.profile-stat__label {
  overflow: hidden;
  color: #68748c;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-stat__value {
  color: #26334f;
  font-size: 0.92rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.profile-stat--active { border-color: #bcebd8; background: #f0fdf8; }
.profile-stat--response { border-color: #cfe0ff; background: #f4f8ff; }
.profile-stat--rate { border-color: #e2d4f7; background: #faf7ff; }
.profile-stat--views { border-color: #d9def0; background: #fafbff; }
.profile-stat__value--with-icon { display: inline-flex; align-items: center; gap: 0.4rem; }
.profile-stat__value--with-icon svg { width: 1.15rem; height: 1.15rem; fill: currentColor; color: #6678b7; }

.profile-eyebrow,
.profile-location,
.profile-username { color: #68748c; }
.profile-section-intro { margin: 0 0 0.65rem; color: #26334f; font-size: clamp(1rem, 2.2vw, 1.15rem); font-weight: 700; line-height: 1.45; }
.profile-eyebrow { min-height: 1rem; margin: 0.7rem 0 0.25rem; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.profile-username-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.4rem;
}
.profile-username-row .profile-username { margin: 0; }
.profile-username-row .profile-trust-pills { margin-top: 0; }
.profile-location { margin: 0.35rem 0 0; }

.profile-card h1,
.profile-message h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.08; }

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  margin-left: 0.5rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  vertical-align: middle;
  background: #91a0bd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.profile-badge--verified {
  background: linear-gradient(135deg, #059669, #10b981);
}

.profile-badge--basic {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.profile-badge--not-verified,
.profile-badge--unknown {
  background: #94a3b8;
}

.profile-trust-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.trust-pill--active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.trust-pill--response {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.trust-pill--rate {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.profile-about { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e5e9f1; }
.profile-about h2 { margin: 0; font-size: 1.2rem; }
.profile-description { max-width: 52rem; margin: 0.8rem 0 0; line-height: 1.72; overflow-wrap: anywhere; white-space: pre-wrap; }
.profile-description.is-empty { color: #7a8497; font-style: italic; }

.profile-social { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin-top: 1.4rem; }
.profile-social a { color: #405bd6; font-weight: 650; text-decoration: none; }
.profile-social a:hover { text-decoration: underline; }

.profile-workspace {
  width: 100%;
  margin: 1.5rem auto 0;
}

.profile-tabs {
  display: flex;
  gap: 0.35rem;
  width: 100%;
  padding: 0.45rem;
  overflow-x: auto;
  border: 1px solid rgba(116, 130, 157, 0.22);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0.65rem 1.8rem rgba(34, 51, 84, 0.08);
  scrollbar-width: thin;
}

.profile-tabs__tab {
  flex: 1 0 auto;
  min-width: 8rem;
  min-height: 2.8rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.7rem;
  color: #5b667c;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.profile-tabs__tab:hover { color: #334bc1; background: #f3f5ff; }
.profile-tabs__tab[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, #405bd6, #6b20d7); box-shadow: 0 0.35rem 0.8rem rgba(64, 91, 214, 0.25); }
.profile-tabs__tab:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.12rem; }
.profile-tab-panels { width: 100%; margin-top: 1rem; }
.profile-tab-panel { width: 100%; }
.profile-tab-panel:focus { outline: none; }
.profile-tab-panel:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.25rem; border-radius: 1.4rem; }

.profile-tab-card {
  width: 100%;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border: 1px solid rgba(116, 130, 157, 0.18);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1rem 2.5rem rgba(34, 51, 84, 0.08);
}

.profile-tab-card.profile-about { margin: 0; padding-top: clamp(1.35rem, 4vw, 2.5rem); border-top: 1px solid rgba(116, 130, 157, 0.18); }
.profile-tab-card.profile-about h2 { font-size: clamp(1.35rem, 4vw, 1.8rem); }
.profile-status { min-height: 1.5rem; margin: 1rem 0 0; color: #28714d; }
.profile-status.is-error { color: #a42d38; }
.profile-card > .profile-status:empty { display: none; }

.profile-dialog {
  width: min(100% - 2rem, 38rem);
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1.5rem 5rem rgba(22, 31, 53, 0.28);
}
.profile-dialog::backdrop { background: rgba(20, 27, 43, 0.58); backdrop-filter: blur(2px); }
.profile-dialog form { display: grid; gap: 1rem; padding: clamp(1.25rem, 5vw, 2rem); }
.profile-dialog-heading, .profile-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.profile-dialog-heading h2 { margin: 0; }
.profile-dialog-heading button { border: 0; color: #59647b; background: transparent; font-size: 2rem; cursor: pointer; }
.profile-dialog label { display: grid; gap: 0.4rem; font-weight: 650; }
.profile-dialog input, .profile-dialog textarea, .profile-dialog select { width: 100%; padding: 0.7rem 0.8rem; border: 1px solid #cbd4e4; border-radius: 0.55rem; color: inherit; background: #fff; font-weight: 400; }
.profile-dialog input[type="checkbox"] { width: auto; }
.profile-dialog textarea { resize: vertical; }
.profile-dialog-actions { justify-content: flex-end; }

/* Tenant preferences are a guided brief rather than a compact edit form. */
.profile-dialog[data-tenant-preferences-dialog] {
  width: min(94vw, 58rem);
  max-width: 58rem;
  max-height: min(92vh, 56rem);
  overflow: hidden;
  border-radius: 1.35rem;
  background: #fbfcff;
  box-shadow: 0 2rem 6rem rgba(22, 31, 53, 0.34);
}
.profile-dialog[data-tenant-preferences-dialog]::backdrop { background: rgba(20, 27, 43, 0.66); backdrop-filter: blur(4px); }
.profile-dialog[data-tenant-preferences-dialog] form { max-height: min(92vh, 56rem); overflow: auto; padding: clamp(1.35rem, 4vw, 2.25rem); background: linear-gradient(180deg, #fbfcff 0%, #fff 16rem); }
.profile-dialog[data-tenant-preferences-dialog] .profile-dialog-heading { align-items: flex-start; padding-bottom: 1rem; border-bottom: 1px solid #e1e7f0; }
.profile-dialog[data-tenant-preferences-dialog] .profile-dialog-heading h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.tenant-preferences__modal-intro { max-width: 42rem; margin: 0.45rem 0 0; color: #68748c; line-height: 1.5; }
.tenant-preferences__wizard-progress { margin: 1rem 0; padding: 0.55rem 0.8rem; border-radius: 0.65rem; color: #405bd6; background: #eef2ff; font-size: 0.86rem; font-weight: 700; }
.tenant-preferences__wizard-step { display: grid; gap: 1rem; }
.tenant-preferences__wizard-step > h3 { margin: 0; color: #202942; font-size: 1.12rem; }
.tenant-preferences__choice-set { display: grid; gap: 0.65rem; min-width: 0; padding: 1rem; border: 1px solid #dbe2ef; border-radius: 0.8rem; background: #f8faff; }
.tenant-preferences__choice-set legend { padding: 0; font-weight: 700; }
.tenant-preferences__checkboxes { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; }
.tenant-preferences__checkboxes label { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 0.92rem; }
.tenant-preferences__checkboxes input { width: auto; min-height: 0; }
[data-tenant-preference-districts] { min-height: 8.5rem; }

.profile-message { margin: clamp(2rem, 12vw, 8rem) auto; padding: clamp(2rem, 8vw, 5rem); border: 1px solid #e0e6f1; border-radius: 1.25rem; background: #fff; text-align: center; box-shadow: 0 1rem 2.5rem rgba(34, 51, 84, 0.08); }
.profile-message p, .profile-loading { color: #64708a; line-height: 1.6; }
.profile-message a, .profile-message button { display: inline-block; padding: 0.75rem 1.1rem; border: 0; border-radius: 0.6rem; color: #fff; background: #405bd6; font: inherit; text-decoration: none; cursor: pointer; }

.profile-skeleton { overflow: hidden; background: linear-gradient(90deg, #e2e8f2 25%, #f4f7fb 50%, #e2e8f2 75%); background-size: 200% 100%; animation: profile-pulse 1.4s infinite; }
.profile-skeleton--line { width: 70%; height: 1.2rem; margin-top: 1.2rem; border-radius: 0.5rem; }

.tenant-preferences {
  width: 100%;
  margin: 0;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border: 1px solid rgba(116, 130, 157, 0.18);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1rem 2.5rem rgba(34, 51, 84, 0.08);
}

.tenant-preferences__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.tenant-preferences__heading h2 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.8rem); }
.tenant-preferences__visibility { margin: 0.4rem 0 0; color: #68748c; }
.tenant-preferences__completion { margin: 0.45rem 0 0; color: #405bd6; font-size: 0.88rem; font-weight: 650; }
.tenant-preferences__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.tenant-preferences__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin: 1.4rem 0 0; }
.tenant-preferences__grid > div { min-width: 0; padding: 1rem; border: 1px solid #e1e7f0; border-radius: 0.8rem; background: #f8faff; }
.tenant-preferences__grid dt { color: #68748c; font-size: 0.82rem; font-weight: 650; }
.tenant-preferences__grid dd { margin: 0.35rem 0 0; font-weight: 720; overflow-wrap: anywhere; }
.tenant-preferences__empty { margin-top: 1.25rem; padding: 1.25rem; border: 1px dashed #bec9dc; border-radius: 0.8rem; background: #f8faff; }
.tenant-preferences__empty h3 { margin: 0; }
.tenant-preferences__empty p { margin: 0.45rem 0 0; color: #68748c; line-height: 1.5; }
.tenant-preferences__form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.tenant-preferences__form-row:has(label:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tenant-preferences__location-field { display: grid; gap: 0.45rem; }
.tenant-preferences__helper { margin: 0; color: #68748c; font-size: 0.85rem; line-height: 1.45; }
.tenant-preferences__location-status { min-height: 1.2rem; margin: 0; color: #28714d; font-size: 0.85rem; }
.tenant-preferences__location-status.is-error { color: #a42d38; }
.tenant-preferences__move-in { display: grid; gap: 0.65rem; min-width: 0; padding: 0; border: 0; }
.tenant-preferences__move-in legend { padding: 0; font-weight: 650; }
.tenant-preferences__move-in-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tenant-preferences__move-in-option { padding: 0.55rem 0.75rem; border: 1px solid #cbd4e4; border-radius: 999px; color: #34405a; background: #fff; cursor: pointer; }
.tenant-preferences__move-in-option:hover, .tenant-preferences__move-in-option.is-selected { border-color: #405bd6; color: #fff; background: #405bd6; }
.tenant-preferences__move-in-option:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.12rem; }
.tenant-preferences__publish { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.tenant-preferences__validation { color: #a42d38; line-height: 1.45; }
.tenant-preferences__validation:empty { display: none; }
.tenant-preferences__dream-images { display: grid; gap: 0.65rem; min-width: 0; padding: 1rem; border: 1px solid #dbe2ef; border-radius: 1rem; background: linear-gradient(135deg, #f3f5ff, #f8fbff); }
.tenant-preferences__dream-images legend { padding: 0; font-size: 1rem; font-weight: 650; }
.tenant-preferences__file-button { width: fit-content; cursor: pointer; }
.tenant-preferences__image-status { min-height: 1.2rem; color: #28714d; font-size: 0.85rem; }
.tenant-preferences__image-status.is-error { color: #a42d38; }
.tenant-preferences__image-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.tenant-preferences__image-item { display: grid; gap: 0.35rem; margin: 0; }
.tenant-preferences__image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0.55rem; border: 1px solid #dbe2ef; }
.tenant-preferences__inspiration { display: grid; gap: 0.85rem; margin-top: 1.25rem; padding: 1.1rem; border: 1px solid #dbe2ef; border-radius: 1rem; background: linear-gradient(135deg, #f7f8ff, #f7fcff); }
.tenant-preferences__inspiration h3 { margin: 0.15rem 0 0; font-size: 1.05rem; }
.tenant-preferences__saved-image-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; }
.tenant-preferences__saved-image-item { min-width: 0; margin: 0; }
.tenant-preferences__saved-image-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #dbe2ef; border-radius: 0.75rem; box-shadow: 0 0.35rem 0.9rem rgba(34, 51, 84, 0.12); }

.profile-listings {
  width: 100%;
  margin: 0;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border: 1px solid rgba(116, 130, 157, 0.18);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1rem 2.5rem rgba(34, 51, 84, 0.08);
}

.profile-listings__heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.profile-listings__heading h2 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.8rem); }
.profile-listings__heading h2:focus { outline: none; }
.profile-listings__share-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.55rem; }
.profile-listings__share-actions .profile-button { gap: 0.45rem; }
.profile-listings__share-actions svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.profile-listings__filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1.25rem; padding: 1rem; border: 1px solid #e1e7f0; border-radius: 0.9rem; background: #f8faff; }
.profile-listings__filters label { display: grid; min-width: 0; gap: 0.35rem; color: #34405a; font-size: 0.82rem; font-weight: 700; }
.profile-listings__filters input, .profile-listings__filters select { width: 100%; min-width: 0; padding: 0.65rem 0.7rem; border: 1px solid #cbd4e4; border-radius: 0.55rem; color: #182033; background: #fff; }
.profile-listings__filter-actions { display: flex; align-items: end; gap: 0.5rem; }
.profile-listings__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.profile-listing-card { min-width: 0; overflow: hidden; border: 1px solid #dfe5ef; border-radius: 0.95rem; background: #fff; box-shadow: 0 0.55rem 1.4rem rgba(34, 51, 84, 0.08); }
.profile-listing-card__link { display: block; height: 100%; color: inherit; text-decoration: none; }
.profile-listing-card__link:hover { box-shadow: inset 0 0 0 2px #91a7ff; }
.profile-listing-card__link:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: -0.2rem; }
.profile-listing-card__media { position: relative; display: grid; height: 11rem; overflow: hidden; place-items: center; background: linear-gradient(135deg, #e9eef7, #ddd8f3); }
.profile-listing-card__media img { width: 100%; height: 100%; object-fit: cover; }
.profile-listing-card__fallback { padding: 1rem; color: #68748c; font-weight: 650; text-align: center; }
.profile-listing-card__badge { position: absolute; top: 0.65rem; left: 0.65rem; padding: 0.3rem 0.5rem; border-radius: 999px; color: #fff; background: #a85415; font-size: 0.75rem; font-weight: 750; }
.profile-listing-card.is-unavailable .profile-listing-card__media img { filter: saturate(0.55); }
.profile-listing-card__body { padding: 1rem; }
.profile-listing-card__body h3 { min-height: 2.7rem; margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.profile-listing-card__body p { margin: 0.5rem 0 0; color: #68748c; }
.profile-listing-card__body .profile-listing-card__price { color: #26334f; font-size: 1.1rem; font-weight: 780; }
.profile-listing-card__details, .profile-listing-card__available { font-size: 0.88rem; }
.profile-listings__message { margin-top: 1.25rem; padding: 1.5rem; border: 1px dashed #bec9dc; border-radius: 0.8rem; background: #f8faff; text-align: center; }
.profile-listings__message h3, .profile-listings__message p { margin: 0; }
.profile-listings__message p { margin-top: 0.45rem; color: #68748c; }
.profile-listings__skeleton { height: 8rem; border-radius: 0.7rem; background: linear-gradient(90deg, #e2e8f2 25%, #f4f7fb 50%, #e2e8f2 75%); background-size: 200% 100%; animation: profile-pulse 1.4s infinite; }
.profile-listings__pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }
.profile-listings__pages { display: flex; align-items: center; gap: 0.35rem; }
.profile-listings__page { min-width: 2.3rem; min-height: 2.3rem; border: 1px solid #c8d1e1; border-radius: 0.5rem; background: #fff; color: #26334f; font: inherit; font-weight: 700; cursor: pointer; }
.profile-listings__page:hover:not(:disabled), .profile-listings__page:focus-visible { border-color: #6b20d7; color: #6b20d7; }
.profile-listings__page[aria-current="page"] { border-color: #6b20d7; background: #6b20d7; color: #fff; cursor: default; }
.profile-share-dialog { width: min(100% - 2rem, 34rem); color: #182033; background: #fff; }
.profile-share-dialog::backdrop { background: rgba(10, 15, 28, 0.7); backdrop-filter: blur(4px); }
.profile-share-dialog__surface { display: grid; gap: 1.1rem; padding: clamp(1.25rem, 5vw, 2rem); }
.profile-share-dialog__intro, .profile-share-dialog__panel p { margin: 0; color: #68748c; }
.profile-share-dialog__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; padding: 0.3rem; border-radius: 0.8rem; background: #eef2f8; }
.profile-share-dialog__tabs button { min-height: 2.8rem; padding: 0.65rem 0.8rem; border: 0; border-radius: 0.6rem; color: #5b667c; background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.profile-share-dialog__tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, #405bd6, #6b20d7); box-shadow: 0 0.3rem 0.7rem rgba(64, 91, 214, 0.25); }
.profile-share-dialog__tabs button:focus-visible { outline: 0.2rem solid #8ea7ff; outline-offset: 0.1rem; }
.profile-share-dialog__panel { display: grid; gap: 0.65rem; padding-top: 0.2rem; }
.profile-share-dialog__panel label { color: #34405a; font-size: 0.86rem; font-weight: 750; }
.profile-share-dialog__url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.55rem; padding: 0.4rem; border: 1px solid #cbd4e4; border-radius: 0.8rem; background: #f8faff; }
.profile-share-dialog__url-row input { min-width: 0; padding: 0.55rem 0.45rem; overflow: hidden; border: 0; outline: 0; color: #26334f; background: transparent; text-overflow: ellipsis; white-space: nowrap; }
.profile-share-dialog__url-row:focus-within { border-color: #405bd6; box-shadow: 0 0 0 0.18rem rgba(64, 91, 214, 0.16); }
.profile-share-dialog__help { font-size: 0.82rem; }
.profile-share-dialog .profile-listings__share-status { min-height: 1.25rem; margin: 0; }

@keyframes profile-pulse { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 40rem) {
  .profile-shell { width: min(100% - 1rem, 80rem); }
  .profile-card { width: 96%; margin-top: -2rem; }
  .profile-title-row { grid-template-columns: 1fr; margin-top: 0; }
  .profile-identity { padding-left: 0; }
  .profile-summary { width: 100%; padding-left: 0; }
  .profile-summary__edit { width: 100%; justify-self: stretch; margin-top: 0; }
  .profile-stats, .profile-trust-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-image-edit--cover { top: 0.6rem; right: 0.6rem; }
  .profile-image-edit--avatar { top: 0.25rem; right: 0.25rem; }
  .profile-dialog-actions .profile-button { flex: 1; }
  .profile-tabs { border-radius: 0.85rem; }
  .profile-tabs__tab { min-width: 7.2rem; }
  .tenant-preferences { width: 100%; }
  .profile-listings { width: 100%; }
  .profile-listings__heading { align-items: stretch; flex-direction: column; }
  .profile-listings__share-actions { display: grid; grid-template-columns: 1fr; }
  .tenant-preferences__heading, .tenant-preferences__actions { display: grid; }
  .tenant-preferences__actions .profile-button { width: 100%; }
  .tenant-preferences__grid, .tenant-preferences__form-row,
  .tenant-preferences__form-row:has(label:nth-child(3)) { grid-template-columns: 1fr; }
  .tenant-preferences__move-in-options { display: grid; grid-template-columns: 1fr 1fr; }
  .profile-dialog[data-tenant-preferences-dialog] { width: min(96vw, 58rem); max-height: 94vh; }
  .profile-dialog[data-tenant-preferences-dialog] form { max-height: 94vh; padding: 1.1rem; }
  .tenant-preferences__image-grid, .tenant-preferences__saved-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-preferences__dream-images { padding: 0.85rem; }
  .profile-listings__filters, .profile-listings__grid { grid-template-columns: 1fr; }
  .profile-listings__filter-actions .profile-button { flex: 1; }
  .profile-listings__pagination { flex-wrap: wrap; gap: 0.55rem; }
  .profile-listings__pagination > .profile-button { flex: 1; }
  .profile-listings__pages { order: -1; width: 100%; justify-content: center; }
}

@media (min-width: 40.01rem) and (max-width: 64rem) {
  .profile-title-row { grid-template-columns: 1fr; margin-top: 0; }
  .profile-identity { padding-left: 0; }
  .profile-summary { width: 100%; padding-left: 0; }
  .profile-summary__edit { justify-self: start; margin-top: 0; }
  .profile-stats, .profile-trust-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tenant-preferences__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-preferences__form-row:has(label:nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-listings__filters, .profile-listings__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) { .profile-skeleton { animation: none; } }

/* --- Profile Header Rating Summary --- */
.profile-header-rating__value { display: flex; min-width: 0; align-items: center; gap: 0.4rem; }
.profile-header-rating__score { font-weight: 700; color: #1e293b; }
.profile-header-rating__stars { color: #f59e0b; font-size: 1rem; letter-spacing: 0.5px; }
.profile-header-rating__count { color: #64748b; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

/* --- Profile Reviews Foundation Section --- */
.profile-reviews-section {
  width: 100%;
  margin: 0;
}
.profile-reviews__card {
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border: 1px solid rgba(116, 130, 157, 0.18);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1rem 2.5rem rgba(34, 51, 84, 0.08);
}

.profile-reviews__summary-box { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid #f1f5f9; }
.profile-reviews__section-title { font-size: 1.25rem; font-weight: 700; color: #1e293b; margin: 0 0 1rem 0; }
.profile-reviews__summary-grid { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: center; }

.profile-reviews__score-col { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-right: 1px solid #f1f5f9; padding-right: 1.5rem; }
.profile-reviews__big-score { font-size: 3rem; font-weight: 800; color: #1e293b; line-height: 1; margin-bottom: 0.35rem; }
.profile-reviews__stars-row { color: #f59e0b; font-size: 1.25rem; letter-spacing: 1px; margin-bottom: 0.35rem; }
.profile-reviews__count-subtext { font-size: 0.875rem; color: #64748b; font-weight: 500; }

.profile-reviews__breakdown-col { display: flex; flex-direction: column; gap: 0.4rem; }
.profile-reviews__bar-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: #475569; }
.profile-reviews__bar-label { min-width: 32px; font-weight: 600; color: #334155; }
.profile-reviews__bar-track { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; position: relative; }
.profile-reviews__bar-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #4f46e5); border-radius: 4px; transition: width 0.3s ease; }
.profile-reviews__bar-count { min-width: 20px; text-align: right; color: #64748b; font-size: 0.8rem; font-weight: 500; }

.profile-reviews__trust { margin-bottom: 1.5rem; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 0.8rem; background: #f8fafc; }
.profile-reviews__trust-title { margin: 0 0 0.8rem; color: #1e293b; font-size: 1rem; }
.profile-reviews__trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.profile-reviews__trust-grid p { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; color: #475569; font-size: 0.85rem; }
.profile-reviews__trust-grid strong { color: #334155; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.035em; }
.profile-reviews__trust .profile-role-chips { margin-top: 0.9rem; }

.profile-reviews__action-box { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; margin-bottom: 1.5rem; padding: 1rem; background: #f8fafc; border-radius: 0.65rem; border: 1px solid #f1f5f9; }
.profile-reviews__write-btn { opacity: 0.65; cursor: not-allowed !important; pointer-events: auto; }
.profile-reviews__disabled-note { font-size: 0.75rem; color: #64748b; margin: 0; }

.profile-reviews__list-box { margin-top: 1rem; }
.profile-reviews__list-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin: 0 0 1rem 0; }
.profile-reviews__empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem 1rem; background: #f8fafc; border-radius: 0.65rem; border: 1px dashed #cbd5e1; }
.profile-reviews__empty-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.6; }
.profile-reviews__empty-title { font-size: 1.05rem; font-weight: 600; color: #334155; margin: 0 0 0.25rem 0; }
.profile-reviews__empty-subtext { font-size: 0.875rem; color: #64748b; margin: 0; }

.profile-reviews__list { display: flex; flex-direction: column; gap: 1rem; }
.profile-reviews__item { padding: 1.15rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.65rem; }
.profile-reviews__item-author { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.profile-reviews__avatar-wrap { position: relative; width: 40px; height: 40px; }
.profile-reviews__author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e2e8f0; }
.profile-reviews__author-fallback { width: 40px; height: 40px; border-radius: 50%; background: #6366f1; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.profile-reviews__author-name { font-weight: 600; color: #1e293b; font-size: 0.95rem; }
.profile-reviews__item-date { font-size: 0.75rem; color: #64748b; }
.profile-reviews__item-rating { color: #f59e0b; margin-bottom: 0.5rem; font-size: 1.05rem; }
.profile-reviews__item-body { font-size: 0.9rem; color: #334155; margin: 0; line-height: 1.5; }
.profile-reviews__error-text { color: #dc2626; font-size: 0.9rem; }

.profile-role-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0; }
.profile-role-chip { border: 1px solid #c7d2fe; border-radius: 999px; color: #3730a3; background: #eef2ff; padding: .18rem .55rem; font-size: .78rem; font-weight: 700; }

@media (max-width: 40rem) {
  .profile-reviews-section { width: 100%; }
  .profile-reviews__summary-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .profile-reviews__score-col { border-right: none; border-bottom: 1px solid #f1f5f9; padding-right: 0; padding-bottom: 1.25rem; }
	.profile-reviews__trust-grid { grid-template-columns: 1fr; }
  .profile-reviews__action-box { align-items: stretch; }
}

/* Keep this final so layout declarations cannot override the hidden state. */
[hidden] { display: none !important; }
