/* Shared CBN identity: logo orange, complete imagery and consistent flag frames. */
:root {
  --cbn-orange: #e17d5f;
  --cbn-orange-rgb: 225, 125, 95;
  --cbn-orange-soft: #ffd7cd;
  --cbn-block-line: var(--line, rgba(255, 255, 255, .14));
  --cbn-image-radius: 18px;
  --cbn-flag-radius: 5px;
  --orange: var(--cbn-orange);
  --red: var(--cbn-orange);
  --role-admin: var(--cbn-orange);
}

/* Preserve the source image, its proportions and the radius of its frame. */
img {
  max-width: 100%;
  object-fit: contain !important;
  border-radius: inherit;
}

/* Content images use their natural height, rather than a cropped fixed viewport. */
.service-media { --cbn-image-radius: 28px; }
.event-banner-image { --cbn-image-radius: 22px; }
.sales-detail-visual { --cbn-image-radius: 24px; }
.cbn-profile-media-tile { --cbn-image-radius: 17px; }
.cbn-event-media-item { --cbn-image-radius: 11px; }
.cbn-media-image { --cbn-image-radius: 13px; }

:is(.service-media, .news-image, .news-banner-image, .news-post-image-large,
    .event-banner-image, .sales-news-card-visual, .sales-detail-visual,
    .cbn-event-cover, .cbn-podcast-art, .cbn-history-cover,
    .cbn-media-image, .cbn-event-media-item) {
  height: auto !important;
  min-height: 0;
  border-radius: var(--cbn-image-radius) !important;
}
:is(.service-media, .welcome-mini-card, .news-image, .news-banner-image,
    .news-post-image-large, .event-banner-image, .sales-news-card-visual,
    .sales-detail-visual, .cbn-event-cover, .cbn-podcast-art, .cbn-history-cover,
    .guest-visual-card, .cbn-media-image, .cbn-profile-media-tile,
    .cbn-event-media-item, .member-media-card.has-image) > img {
  position: static !important;
  inset: auto !important;
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto;
  border-radius: var(--cbn-image-radius) !important;
  object-position: center !important;
}
.service-media:has(> img) { background: transparent !important; }
.cbn-welcome-final { background-size: contain !important; }
.cbn-profile-media-tile, .member-media-card.has-image {
  grid-template-rows: auto auto !important;
}
.cbn-registration-media-frame:has(img) { grid-template-rows: auto !important; }
.news-journal-image { border-radius: 18px; }
.news-journal-image > img { border-radius: inherit; }

/* Small photos and agent portraits keep the whole picture inside rounded blocks. */
:is(.cbn-sidebar-agent-avatar, .member-card-avatar, .directory-contact-photo,
    .member-photo-preview, .cbn-event-host-photo, .chat-member-photo,
    .cbn-profile-photo-preview, .cbn-collaborator-avatar, .mozart-mark,
    .iris-mark, .agent-command-avatar, .cbn-hunter-agent-summary img,
    .cbn-prospect-owner-visual img, .cbn-member-owner-visual img) {
  border-radius: 14px !important;
}
.cbn-sidebar-agent-avatar { border-radius: 16px !important; }
.member-card-avatar { border-radius: 16px !important; }
.cbn-profile-visuals .member-photo-preview { border-radius: 22px !important; }
:is(.member-card-avatar, .directory-company-logo, .directory-contact-photo,
    .member-photo-preview, .cbn-event-host-logo, .cbn-event-host-photo,
    .chat-member-photo, .chat-member-company-logo, .cbn-profile-photo-preview,
    .cbn-collaborator-avatar, .mozart-mark, .iris-mark) {
  display: grid;
  place-items: center;
}
:is(.member-card-avatar, .directory-company-logo, .directory-contact-photo,
    .member-photo-preview, .cbn-event-host-logo, .cbn-event-host-photo,
    .chat-member-photo, .chat-member-company-logo, .cbn-profile-photo-preview,
    .cbn-collaborator-avatar, .mozart-mark, .iris-mark) > img {
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 100%;
  border-radius: inherit !important;
}
.member-profile-certification-fit img { border-radius: inherit !important; }

/* Every country flag uses the same rectangular frame as the other blocks. */
:is(.directory-country-flag, .sales-route-flag,
    .iris-welcome-thumb-flag, .iris-welcome-full-flag) {
  --cbn-flag-width: 36px;
  width: var(--cbn-flag-width) !important;
  height: auto !important;
  min-width: var(--cbn-flag-width);
  aspect-ratio: 3 / 2;
  flex: 0 0 var(--cbn-flag-width) !important;
  display: grid;
  place-items: center;
  border: 1px solid var(--cbn-block-line) !important;
  border-radius: var(--cbn-flag-radius) !important;
  background: transparent;
  overflow: hidden;
  box-sizing: border-box;
}
.sales-route-flag { --cbn-flag-width: 27px; }
.sales-news-place .sales-route-flag { --cbn-flag-width: 30px; }
.sales-detail-place .sales-route-flag { --cbn-flag-width: 48px; }
.cbn-prospect-row-status .directory-country-flag { --cbn-flag-width: 39px; }
.iris-welcome-thumb-flag { --cbn-flag-width: 42px; }
.iris-welcome-full-flag { --cbn-flag-width: 63px; }
:is(.directory-country-flag, .sales-route-flag,
    .iris-welcome-thumb-flag, .iris-welcome-full-flag) > img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  border-radius: inherit !important;
  object-position: center !important;
}
:is(.directory-country-flag, .sales-route-flag) > span { transform: none; }

/* Former red actions share the exact logo colour; labels keep their meaning. */
body :is(button.danger, .chat-delete-btn, .news-danger, .blacklist-admin-btn,
    .finance-dispute-btn, .account-request-actions .danger, .cbn-history-delete) {
  background: var(--cbn-orange) !important;
  border-color: var(--cbn-orange) !important;
  color: #071225 !important;
}
body .agent-status-filters button[data-status="undeliverable"].active {
  background: var(--cbn-orange) !important;
  border-color: var(--cbn-orange) !important;
  color: #071225 !important;
}
#login-screen #login-btn {
  background: var(--cbn-orange) !important;
  color: #071225 !important;
}
