/* Existing editor hooks and layout remain intact. Root must be on the modal itself. */
.tj-profile-modal[data-tj-ui="cinematic"] {
  --tj-profile-ink: var(--tj-text);
  --tj-profile-surface: var(--tj-surface);
  background: transparent;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card {
  border: 1px solid var(--tj-border);
  border-radius: var(--tj-radius-modal);
  background: var(--tj-surface);
  color: var(--tj-text);
  box-shadow: 0 24px 80px rgb(0 0 0 / .5);
  font-family: var(--tj-font-body);
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-head {
  border-bottom: 1px solid var(--tj-border);
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-head h2 {
  font-family: var(--tj-font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-kicker {
  padding: 0;
  background: transparent;
  color: var(--tj-pink-soft);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-close {
  border: 1px solid var(--tj-border);
  border-radius: var(--tj-radius-sm);
  background: var(--tj-surface-raised);
  color: var(--tj-text);
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-field > label {
  font-size: .875rem;
  font-weight: 600;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-field :is(input:not([type=checkbox]):not([type=file]):not([type=hidden]), textarea, select:not(.select2-hidden-accessible)) {
  border: 1px solid var(--tj-text-subtle);
  border-radius: var(--tj-radius-sm);
  background: var(--tj-surface-raised);
  color: var(--tj-text);
  min-height: 44px;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-field :is(input, textarea)::placeholder { color: var(--tj-text-muted); opacity: 1; }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-help { color: var(--tj-text-muted); font-size: .875rem; }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-form-actions { border-top: 1px solid var(--tj-border); }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-form-actions button {
  min-height: 44px;
  padding: .75rem 1.25rem;
  border: 1px solid var(--tj-text-subtle);
  border-radius: var(--tj-radius-sm);
  background: transparent;
  color: var(--tj-text);
  box-shadow: none;
  font-size: .875rem;
  font-weight: 700;
  text-transform: none;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-form-actions .tj-profile-save { border-color: var(--tj-pink); background: var(--tj-pink); color: var(--tj-on-accent); }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-form-actions .tj-profile-save:hover { border-color: var(--tj-pink-hover); background: var(--tj-pink-hover); color: var(--tj-white); }
.tj-profile-modal[data-tj-ui="cinematic"] :is(button, input, textarea, select):focus-visible { outline: 3px solid var(--tj-focus); outline-offset: 3px; }

/* Native field labels must not inherit the Elementor Primary background role. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-field > label { color:var(--tj-text); }
/* Native uploader presentation only; keep file inputs, previews and handlers intact. */
.tj-profile-modal[data-tj-ui="cinematic"] .tju {
 --tju-ink:var(--tj-border); padding:16px; background:var(--tj-surface-raised); color:var(--tj-text); border-color:var(--tj-text-subtle); min-width:0; max-width:100%;
}
.tj-profile-modal[data-tj-ui="cinematic"] .tju:is(:hover,.is-dragover) { background:var(--tj-surface); border-color:var(--tj-pink); }
.tj-profile-modal[data-tj-ui="cinematic"] .tju .tju-title { white-space:normal; overflow-wrap:anywhere; font-size:.875rem!important; font-weight:600!important; line-height:1.4!important; max-width:100%; }
.tj-profile-modal[data-tj-ui="cinematic"] .tju .tju-subtitle { white-space:normal; overflow-wrap:anywhere; font-size:.75rem!important; line-height:1.5!important; text-transform:none; }
.tj-profile-modal[data-tj-ui="cinematic"] .tju .tju-limits { color:var(--tj-text-muted); opacity:1; font-weight:500!important; }
.tj-profile-modal[data-tj-ui="cinematic"] .tju .tju-media { max-width:100%; background:var(--tj-surface); border-color:var(--tj-border); border-radius:var(--tj-radius-sm)!important; }
.tj-profile-modal[data-tj-ui="cinematic"] .tju .tju-error { color:var(--tj-pink-soft); }

/* Enhanced choices owned by native profile editors only. */
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container { max-width:100%; min-width:0; }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container--default :is(.select2-selection--single,.select2-selection--multiple) { min-height:44px; border:1px solid var(--tj-text-subtle); border-radius:var(--tj-radius-sm); background:var(--tj-surface-raised); color:var(--tj-text); }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container--default .select2-selection__rendered { color:var(--tj-text); }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container--default .select2-selection__choice { max-width:100%; white-space:normal; overflow-wrap:anywhere; border:1px solid var(--tj-border); border-radius:var(--tj-radius-sm); background:var(--tj-bg); color:var(--tj-text); }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container--default .select2-selection__choice__remove { color:var(--tj-text-muted); }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container .select2-search__field { min-width:0!important; max-width:100%; min-height:24px!important; height:auto!important; padding:0!important; border:0!important; background:transparent!important; color:var(--tj-text)!important; -webkit-text-fill-color:var(--tj-text)!important; font:400 .875rem/1.5 var(--tj-font-body); box-shadow:none!important; }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container .select2-search__field::placeholder { color:var(--tj-text-muted)!important; -webkit-text-fill-color:var(--tj-text-muted)!important; opacity:1; }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-dropdown { background:var(--tj-surface)!important; color:var(--tj-text)!important; border-color:var(--tj-text-subtle)!important; }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-results__option { color:var(--tj-text); overflow-wrap:anywhere; font:400 .875rem/1.5 var(--tj-font-body); }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container--default .select2-results__option[aria-selected=true] { background:var(--tj-surface-raised); }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-container--default .select2-results__option--highlighted[aria-selected] { background:var(--tj-pink)!important; color:var(--tj-on-accent)!important; }
.tj-profile-modal[data-tj-ui="cinematic"] .select2-selection:focus-visible { outline:3px solid var(--tj-focus); outline-offset:3px; }
/* Legacy PHP editor declares these surfaces important; keep the override native and local. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card .select2-container :is(.select2-selection--single,.select2-selection--multiple) { background:var(--tj-surface-raised)!important; color:var(--tj-text)!important; border-color:var(--tj-text-subtle)!important; }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-cipe-pro-group { background:var(--tj-surface-raised); border-color:var(--tj-border); }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-cipe-pro-group-head { background:var(--tj-surface); color:var(--tj-text); border-color:var(--tj-border); }

/* Company professional controls retain native markup and handlers. */
.tj-coipe-modal[data-tj-ui="cinematic"] .tj-coipe-pro-field textarea.tj-profile-control {
  background:var(--tj-surface-raised) !important;
  color:var(--tj-text) !important;
  border-color:var(--tj-text-subtle) !important;
}
.tj-coipe-modal[data-tj-ui="cinematic"] button.tj-coipe-cancel {
  color:var(--tj-text) !important;
  border-color:var(--tj-text-subtle);
}

.tj-coipe-modal[data-tj-ui="cinematic"] .tj-coipe-pro { background:var(--tj-surface-raised); border-color:var(--tj-border); }
.tj-coipe-modal[data-tj-ui="cinematic"] .tj-coipe-pro-head { background:var(--tj-surface); color:var(--tj-text); border-color:var(--tj-border); }

/* Native Company location label is nested outside the shared field wrapper. */
.tj-coipe-modal[data-tj-ui="cinematic"] #tj-coipe-location-label { color:var(--tj-text); }

/* Native Creative location label also sits outside the shared field wrapper. */
.tj-cipe-modal[data-tj-ui="cinematic"] #tj-cipe-location-label { color:var(--tj-text); }

/* Native location guidance and saved-location summaries on dark profile editors. */
.tj-cipe-modal[data-tj-ui="cinematic"] .tj-cipe-google-location-status.is-success { color:var(--tj-text-muted); font:400 .875rem/1.5 var(--tj-font-body); }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-location-summary { background:var(--tj-surface-raised); color:var(--tj-text); border-color:var(--tj-border); font-size:.875rem; line-height:1.5; }
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-location-summary strong { font-size:inherit; color:inherit; }

/* Secondary actions in the native social-link repeaters. */
.tj-profile-modal[data-tj-ui="cinematic"] :is(.tj-cipe-social-remove,.tj-coipe-social-remove,.tj-cipe-social-add,.tj-coipe-social-add) { background:var(--tj-surface-raised)!important; color:var(--tj-text)!important; border:1px solid var(--tj-text-subtle)!important; border-radius:var(--tj-radius-sm)!important; font-size:.875rem!important; line-height:1.5!important; }
.tj-profile-modal[data-tj-ui="cinematic"] :is(.tj-cipe-social-remove,.tj-coipe-social-remove,.tj-cipe-social-add,.tj-coipe-social-add):hover { background:var(--tj-surface)!important; color:var(--tj-text)!important; border-color:var(--tj-text)!important; }

/* Native Company enhanced-select empty messages retain readable dark-menu contrast. */
.tj-coipe-modal[data-tj-ui="cinematic"] .select2-results__message { color:var(--tj-text)!important; background:var(--tj-surface)!important; }

/* The native full-width selection rule must not stretch its absolute dropdown attachment. */
.tj-coipe-modal[data-tj-ui="cinematic"] > .select2-container:has(> .select2-dropdown),
.tj-coipe-modal[data-tj-ui="cinematic"] .tj-coipe-card > .select2-container:has(> .select2-dropdown) { width:max-content!important; }

.tj-coipe-modal[data-tj-ui="cinematic"] > .select2-container > .select2-dropdown,
.tj-coipe-modal[data-tj-ui="cinematic"] .tj-coipe-card > .select2-container > .select2-dropdown { max-width:none!important; }

/* Native Company dropdown rows override embedded legacy palette only. */
.tj-coipe-modal[data-tj-ui="cinematic"] .select2-results__option { background:var(--tj-surface)!important; color:var(--tj-text)!important; }
.tj-coipe-modal[data-tj-ui="cinematic"] .select2-results__option.select2-results__option--selected { background:var(--tj-surface-raised)!important; color:var(--tj-text)!important; }
.tj-coipe-modal[data-tj-ui="cinematic"] .select2-results__option.select2-results__option--highlighted { background:var(--tj-pink)!important; color:var(--tj-on-accent)!important; }

/* Keep native image-editor Close visible when keyboard focus wraps inside the scrolling card. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card:has(:is([data-tj-cipe-form="image"],[data-tj-coipe-form="image"])) > .tj-profile-head { position:sticky; top:0; z-index:2; background:var(--tj-surface); }

/* Keep Close visible when focus wraps in native contact editors. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card:has(:is([data-tj-cipe-form="contact"],[data-tj-coipe-form="contact"])) > .tj-profile-head { position:sticky; top:0; z-index:2; background:var(--tj-surface); box-shadow:0 -28px 0 var(--tj-surface); }

/* Keep Close visible in the remaining observed scrolling profile forms. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card:has(:is([data-tj-cipe-form="identity"],[data-tj-cipe-form="facts"],[data-tj-cipe-form="skills"],[data-tj-cipe-form="about"],[data-tj-cipe-form="professional"],[data-tj-coipe-form="identity"],[data-tj-coipe-form="about"],[data-tj-coipe-form="professional"])) > .tj-profile-head { position:sticky; top:0; z-index:2; background:var(--tj-surface); box-shadow:0 -28px 0 var(--tj-surface); }

/* Reserve the sticky heading when focused controls scroll into native editor cards. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card { scroll-padding-top:8rem; scroll-padding-bottom:1rem; }
/* Native legacy selected-value rules are important; keep text readable within marked editors. */
.tj-profile-modal[data-tj-ui="cinematic"] .tj-profile-card .select2-container .select2-selection--single .select2-selection__rendered { color:var(--tj-text)!important; }
